SQL Server vs PostgreSQL: a practical comparison
SQL Server is Microsoft's commercial relational database, with its own T-SQL dialect; PostgreSQL is an open-source relational database run by a community project. Both handle transactional workloads at scale; they differ most in licensing, default concurrency behavior and SQL dialect.
Side by side
| SQL Server | PostgreSQL | |
|---|---|---|
| License | Commercial, per core; free Express and Developer editions | PostgreSQL License (permissive), no license fees |
| Platforms | Windows and Linux | Linux, Windows, macOS and other Unix systems |
| Default concurrency | Locking read committed; row versioning (RCSI, snapshot isolation) is opt-in | MVCC always; readers never block writers |
| Procedural language | T-SQL | PL/pgSQL, plus others through extensions |
| Row limiting | TOP n, or OFFSET ... FETCH | LIMIT n, or OFFSET ... FETCH |
| Upsert | MERGE | INSERT ... ON CONFLICT; MERGE from version 15 |
| JSON | Functions over text columns (JSON_VALUE, OPENJSON) | json and jsonb types, jsonb indexable with GIN |
| Analytics features | Columnstore indexes | BRIN indexes, extensions |
| High availability | Always On availability groups, log shipping | Streaming and logical replication; failover through tools such as Patroni |
| Identifier case | Depends on collation, usually case-insensitive | Unquoted names fold to lowercase |
Concurrency: locks vs versions
This is the difference engineers notice first. By default SQL Server's read committed level takes shared locks, so a long update can block readers of the same rows. Turning on READ_COMMITTED_SNAPSHOT switches it to row versioning, with old versions kept in tempdb. PostgreSQL always uses MVCC: each statement sees a snapshot, and old row versions stay in the table until VACUUM reclaims them.
Dialect differences
Most porting work is small syntax. String concatenation is + in T-SQL and || in Postgres. T-SQL quotes identifiers with [brackets]; Postgres uses double quotes. Date functions differ in name and argument order.
SELECT TOP 10 first_name + ' ' + last_name AS full_name,
DATEDIFF(day, hired_at, GETDATE()) AS days_employed
FROM dbo.employees
ORDER BY hired_at DESC;SELECT first_name || ' ' || last_name AS full_name,
current_date - hired_at::date AS days_employed
FROM public.employees
ORDER BY hired_at DESC
LIMIT 10;Typical use
SQL Server fits organizations already on the Microsoft stack: .NET applications, Active Directory authentication, SSIS and SSRS, and Azure. Its license cost is real at scale, and the tooling around it is integrated. PostgreSQL is the default for new open-source and cloud-native applications, with managed versions on every major cloud and a large extension ecosystem. Teams moving off SQL Server usually spend most of the effort on stored procedures written in T-SQL, not on the tables. For analytics on either, see OLAP vs OLTP.
In Thunderduck
Thunderduck connects to both: SQL Server over ODBC, PostgreSQL as its own catalog type, and one query can join the two. SQL Server catalogs are read-only: INSERT, UPDATE, DELETE, MERGE and DDL are refused whatever the login allows. Filters and LIMIT are pushed down to SQL Server except LIKE, and comparisons there follow the database collation, so 'a' = 'A' can match. PostgreSQL catalogs are writable unless marked read-only.
A common pattern is copying SQL Server data into Postgres or Iceberg with INSERT ... SELECT, on a schedule. SQL Server catalogs are not available in dbt pipelines, and one query can reference at most 16 Oracle or SQL Server tables.
Docs: https://docs.thunderduck.ai/catalogs/oracle-sqlserver/