01SQL Server → PostgreSQL · Part 1 SQL Server to PostgreSQL: Why Switch, and What to Expect Thinking about moving from SQL Server to PostgreSQL? Why teams switch, what stays familiar, what changes, and how to get your first Postgres running. Aug 6, 2026 · 5 min read →
03SQL Server → PostgreSQL · Part 3 Data Types: The SQL Server → PostgreSQL Translation Table The full SQL Server to PostgreSQL data-type table. NVARCHAR to text, DATETIME2 to timestamptz, UNIQUEIDENTIFIER to uuid, plus the powers of jsonb and arrays. Aug 6, 2026 · 6 min read →
04SQL Server → PostgreSQL · Part 4 The T-SQL → PostgreSQL Phrasebook The everyday T-SQL to PostgreSQL translation guide. TOP to LIMIT, ISNULL to COALESCE, SCOPE_IDENTITY to RETURNING, MERGE to ON CONFLICT, worth bookmarking. Aug 6, 2026 · 7 min read →
07SQL Server → PostgreSQL · Part 7 Backup and Restore in PostgreSQL, for SQL Server DBAs Every SQL Server backup type has a PostgreSQL equivalent. pg_dump, pg_basebackup and WAL archiving with point-in-time recovery, mapped to what you know. Aug 6, 2026 · 6 min read →
08SQL Server → PostgreSQL · Part 8 PostgreSQL with .NET and EF Core — and Your Migration Plan Connect .NET to PostgreSQL with Npgsql and EF Core. Move the actual data, then wrap up the series with a practical switch-over checklist. Aug 6, 2026 · 6 min read →
04Set Up a Windows PC for .NET Development · Part 4 Databases on a Dev PC: LocalDB, Express and PostgreSQL in Docker LocalDB, SQL Server Express and PostgreSQL in Docker on one PC. Which one a connection string reaches, three slow errors, and the tools you already have. Oct 14, 2026 · 6 min read →
04From Prompt to Production · Part 4 Spec to Schema: Designing PostgreSQL Tables with AI Turn the spec into PostgreSQL DDL with AI. Then catch its mistakes in a schema review: the missing FK index, the naive timestamp, and the partial unique index. Aug 9, 2026 · 7 min read →
05Docker for .NET Developers on Windows · Part 5 PostgreSQL in a Container for a .NET App PostgreSQL in Docker for a .NET app, step by step. Variables, the init script, the volume that keeps data, and connection strings from Windows and a container. Oct 14, 2026 · 6 min read →
Databases & Data PostgreSQL vs SQL Server for .NET Developers: The Real Differences PostgreSQL vs SQL Server, decided by someone who ran both. Licensing, EF Core support, tooling, hosting, JSON, full-text search, and what hurts in a migration. Sep 4, 2026 · 9 min read →
Databases & Data PostgreSQL 16 vs 18 for .NET Developers: Run Side by Side PostgreSQL 16 vs 18, run side by side. uuidv7, virtual generated columns, RETURNING OLD and NEW, temporal keys, skip scans, and how to move a dev database. Oct 14, 2026 · 6 min read →
Fixes PostgreSQL: '23505: duplicate key value violates unique constraint' after seeding rows Explicit ids in seed rows leave the identity sequence behind. One setval moves it past the highest id; the fix and the HasData check are inside. Sep 25, 2026 · 3 min read →
02SQL Server → PostgreSQL · Part 2 Instances, Databases, Schemas and Roles: Remapping Your Mental Model Remap your SQL Server mental model for PostgreSQL. Instance vs cluster, dbo vs public, logins vs roles, and why cross-database queries do not work as expected. Aug 6, 2026 · 6 min read →
06SQL Server → PostgreSQL · Part 6 Indexes, MVCC and Performance: Unlearning the Clustered Index PostgreSQL has no clustered index. Readers never block writers either, so here are MVCC, VACUUM, EXPLAIN ANALYZE and the new index types for SQL Server folks. Aug 6, 2026 · 7 min read →
Fixes postgres:18 Docker container exits immediately: mount the volume at /var/lib/postgresql The postgres:18 image stops right after starting. The data directory moved, so your old /var/lib/postgresql/data mount is the problem. Mount one level up. Sep 4, 2026 · 5 min read →
Fixes PostgreSQL: 'date/time field value out of range', 'Perhaps you need a different DateStyle' (22008) PostgreSQL read a day-first date as month-first. The 22008 and 22007 date errors, the ISO and to_date fixes and the DateStyle trap are inside. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'column must appear in the GROUP BY clause or be used in an aggregate function' (42803) A selected column is neither grouped nor aggregated. Why PostgreSQL refuses it and the two fixes, with real psql output. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'operator does not exist: integer = text' (42883) Two sides of a comparison have different types. Where to put the explicit cast PostgreSQL hints at, and where not to. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'value too long for type character varying(n)' (22001) A string is longer than its varchar or char limit. Why the row is rejected, when PostgreSQL truncates instead, and the fix. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'current transaction is aborted, commands ignored until end of transaction block' (25P02) One failed statement poisons the whole PostgreSQL transaction. ROLLBACK, a savepoint or a new Npgsql transaction fixes it; tested psql and C# inside. Oct 30, 2026 · 2 min read →
Fixes PostgreSQL: 'invalid input syntax for type integer' (22P02) in psql and Npgsql PostgreSQL could not read your text value as an integer. Why psql and Npgsql raise it, and how to validate input and find bad rows, is inside. Oct 30, 2026 · 3 min read →
Fixes PostgreSQL: 'relation "customers" already exists' (42P07) in scripts and EF Core A CREATE ran for a table PostgreSQL already has. Fix scripts with IF NOT EXISTS and EF Core with an honest __EFMigrationsHistory; both are inside. Oct 30, 2026 · 2 min read →
Fixes PostgreSQL: 'sorry, too many clients already' (53300) and reserved connection slots Every PostgreSQL connection slot is taken, usually by a leak. How to find who holds them, close them in Npgsql and raise the limit is inside. Oct 30, 2026 · 2 min read →
Fixes PostgreSQL: 'ERROR: column "firstname" does not exist' (42703) on a mixed-case column Quoted mixed-case columns need the same quotes in every query. Why PostgreSQL lowers FirstName to firstname, and two tested fixes, are inside. Oct 23, 2026 · 2 min read →
Fixes PostgreSQL 15+: 'ERROR: permission denied for schema public' Since PostgreSQL 15 only the database owner may create in public. Why the default changed, and the GRANT fix, run and confirmed on 18. Oct 9, 2026 · 2 min read →
Fixes PostgreSQL: 'ERROR: relation "customers" does not exist' (42P01) The table was created with a quoted mixed-case name. Why PostgreSQL folds names to lower case, and the quoting fix, run and confirmed. Oct 9, 2026 · 2 min read →
05SQL Server → PostgreSQL · Part 5 Stored Procedures, Functions and Triggers in PL/pgSQL Rewrite T-SQL stored procedures in PL/pgSQL. Procedures vs functions, RAISE NOTICE, RETURNS TABLE and triggers, with a real procedure translated line by line. Aug 6, 2026 · 7 min read →
Fixes psql: 'connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory' psql found no server on the local Unix socket. Why the socket file is missing and the two fixes, -h host or starting the server, are inside. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'function ... does not exist', 'You might need to add explicit type casts' (42883) The function exists with other argument types. How to read the types in the error and the cast that fixes the call are inside. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'must be owner of table' on ALTER TABLE (42501) The role can use the table but does not own it. Why GRANT is not enough for ALTER TABLE and the OWNER TO fix are inside. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'cannot execute INSERT in a read-only transaction' (25006) The transaction or the database was set read only. How to find the setting and the order that switches it off are inside. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'database already exists' (42P04) and 'role already exists' (42710) A setup script created the same database or role twice. The guards that make the script safe to rerun are inside, tested. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'integer out of range' (22003) A value or a calculation went past 2147483647. The three ways it happened and the bigint fixes for columns and arithmetic are inside. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'null value in column violates not-null constraint' (23502) A NOT NULL column received NULL, often by being left out. How to read the DETAIL row and fix it with a value or a default. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'insert or update on table violates foreign key constraint' (23503) The parent row is missing, or still referenced on delete. Both 23503 messages reproduced, with the fix for each. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'FATAL: no pg_hba.conf entry for host, user, database, no encryption' No pg_hba.conf rule matches the client. How to read the message, add the right host line and reload without a restart. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'ERROR: deadlock detected' (40P01) Two transactions locked rows in opposite order. A real two-session deadlock, the server log entry and the lock-order fix. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'there is no unique or exclusion constraint matching the ON CONFLICT specification' (42P10) An upsert names columns with no unique constraint. Why a plain index is not enough and the one-line fix, with real output. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'cannot insert a non-DEFAULT value into column "id"' (428C9) An explicit id went into a GENERATED ALWAYS column. Leave it out, or override and reset the sequence, as shown here. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'cannot drop table because other objects depend on it' (2BP01) A view or foreign key still uses the table. How to read the DETAIL list and what DROP CASCADE really removes. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'syntax error at or near "user"' with a reserved word (42601) A reserved word such as user was used as a name. Quote it or rename it, and the trap of an unquoted SELECT FROM user. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'canceling statement due to statement timeout' (57014) A statement ran past statement_timeout. Find where the limit is set and raise it for one transaction with SET LOCAL. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'CREATE DATABASE cannot run inside a transaction block' (25001) The statement ran after BEGIN, yours or a tool's. VACUUM says the same; run it on its own, as shown here. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'column cannot be cast automatically to type integer' (42804) ALTER COLUMN TYPE from text needs a USING clause. The fix, and how to find the rows that will not convert. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'new row for relation violates check constraint' (23514) A value breaks a CHECK rule on the table. How to read the rule and the failing row, and why NULL slips through. Nov 6, 2026 · 2 min read →
Fixes PostgreSQL: 'psql: FATAL: Peer authentication failed for user "postgres"' Peer login means your Linux user must match the database role. Use sudo -u postgres psql or a password over TCP; the tested fixes are inside. Oct 23, 2026 · 2 min read →
Fixes PostgreSQL: 'ERROR: database "shopdb" is being accessed by other users' (55006) Another session is still connected to the database you drop. DROP DATABASE WITH (FORCE) or pg_terminate_backend fixes it; both tested inside. Oct 23, 2026 · 2 min read →
Fixes PostgreSQL in WSL: 'initdb: error: could not change permissions of directory' on /mnt/c initdb fails on /mnt/c in WSL with Operation not permitted. The Windows drive keeps no Linux owners or modes; the fix and a timed test are inside. Oct 22, 2026 · 3 min read →
Fixes Docker postgres: 'initdb: error: directory "/var/lib/postgresql/data" exists but is not empty' Postgres in Docker exits because the data folder is not empty. A hidden file or another version's data sits in the mount; two tested fixes are inside. Oct 22, 2026 · 2 min read →
Fixes PostgreSQL: 'FATAL: role "app" does not exist' The role you log in as was never created on the server. Why Docker makes only one role, and the CREATE ROLE fix, run and confirmed. Oct 9, 2026 · 2 min read →
Fixes PostgreSQL: 'FATAL: database "appdb" does not exist' The login worked but the database was never created. Why psql falls back to the user name, and the CREATE DATABASE fix, run and confirmed. Oct 9, 2026 · 2 min read →
Fixes PostgreSQL: 'pg_dump: error: aborting because of server version mismatch' Your pg_dump is older than the server it is dumping. Why it refuses, and the matching-client fix in Docker, run and confirmed. Oct 9, 2026 · 2 min read →
Fixes Npgsql: 'Cannot write DateTime with Kind=Local to PostgreSQL type timestamp with time zone' Npgsql refuses DateTime.Now for a timestamptz column. The column stores UTC instants, so convert first; the fix and the legacy switch are inside. Sep 25, 2026 · 2 min read →
01Database Design for Developers · Part 1 From ER Diagram to CREATE TABLE: Turning Entities into Real Tables Turn an ER diagram into real tables. Patients and appointments built on SQL Server and PostgreSQL side by side, with the first join and the first failed insert. Sep 26, 2026 · 6 min read →
01Student Projects: From Conversation to Database · Part 1 Library Management System Database Design: ER Diagram, Tables and SQL A library database, designed from a talk with the librarian. Copies, members, loans, fines and reservations, with scripts run on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
02Student Projects: From Conversation to Database · Part 2 School Management System Database Design: ER Diagram, Tables and SQL A school database, designed from a talk with the office manager. Sections, teachers, subjects, marks and guardians, scripts on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
03Student Projects: From Conversation to Database · Part 3 Attendance Management System Database Design: ER Diagram, Tables and SQL An attendance database, designed from a talk with HR. Shifts, check-ins, a derived status, leave and holidays, scripts on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
04Student Projects: From Conversation to Database · Part 4 Hostel Management System Database Design: ER Diagram, Tables and SQL A hostel database, designed from a talk with the warden. Blocks, rooms, beds, allotments, fees, mess and complaints, scripts on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
05Student Projects: From Conversation to Database · Part 5 Hospital Management System Database Design: ER Diagram, Tables and SQL A hospital database, designed with its superintendent. Wards, beds, admissions, prescriptions and bills, scripts on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
05From Prompt to Production · Part 5 Scaffold to Skeleton: Blazor Server, EF Core and Npgsql From template to skeleton with an AI pair. The SQLite to PostgreSQL swap, the first migration, a seeder, and the rule that makes AI scaffolding safe. Aug 9, 2026 · 8 min read →
06Docker for .NET Developers on Windows · Part 6 Compose: The App and Its Database from One File Docker Compose for a .NET app and PostgreSQL, run for real. The healthcheck the app waits for, the .env trap, rebuilds, down against down -v, profiles, watch. Oct 14, 2026 · 6 min read →
06Student Projects: From Conversation to Database · Part 6 Inventory Management System Database Design: ER Diagram, Tables and SQL A shop inventory database, designed from a talk with the owner. Products, suppliers, purchases, sales and a stock ledger, scripts on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
06Claude Code for .NET Developers · Part 6 Give Claude Code Your Database Schema: A Read-Only MCP Server in C# Build a read-only MCP server in C# for Claude Code. Three tools over PostgreSQL, a role that can only read, and a DELETE refused three ways. Oct 2, 2026 · 6 min read →
08Database Design for Developers · Part 8 Naming Conventions: Singular or Plural, snake_case or PascalCase Database naming conventions that survive two engines. Case folding in PostgreSQL, collation in SQL Server, reserved words, and a rule list to keep. Sep 26, 2026 · 5 min read →
08Student Projects: From Conversation to Database · Part 8 Railway Reservation System Database Design: ER Diagram, Tables and SQL A railway booking database, designed with the booking office. Routes, coaches, seats, fares, bookings and waitlists, on SQL Server and PostgreSQL. Oct 16, 2026 · 7 min read →
09Database Design for Developers · Part 9 Indexes Explained With Query Plans: Which Columns to Index Which columns should you index? Three queries on 200,000 appointments, before and after, with the plans and timings from SQL Server and PostgreSQL. Sep 26, 2026 · 6 min read →
Fixes Npgsql: 'Detail redacted as it may contain sensitive data' and Include Error Detail Npgsql hides PostgreSQL's DETAIL line unless you opt in. How to see it in development, why it stays off in production, and the fix inside. Oct 22, 2026 · 2 min read →
Fixes postgres:18 in Docker: 'database files are incompatible with server' after upgrading from 16 PostgreSQL 18 cannot open a data directory made by 16. Move the data with pg_dumpall or pg_upgrade into a new volume; both routes are tested here. Oct 2, 2026 · 3 min read →