Quick verdict
Choose SQL Server if your organisation runs on Microsoft technology, your team writes T-SQL, and you want one vendor for engine, tooling, Azure services and support, accepting per core licence costs above the free Express limits. Choose PostgreSQL if you want a full featured open source database with no licence fees or edition limits, native macOS and BSD support, and an extension ecosystem, accepting that support and some tooling come from third parties.
SQL Server is Microsoft's relational database. The current release is SQL Server 2025 (17.x), and Microsoft's update list showed Cumulative Update 9 (build 17.0.5005.3, September 2026) as the latest when we checked. Paid editions are Enterprise and Standard; the free editions are Express (usable in production, with resource limits) and Developer, which in SQL Server 2025 comes as Standard Developer and Enterprise Developer and is licensed for development and test only. Web edition is not available from SQL Server 2025.
PostgreSQL is developed by the PostgreSQL Global Development Group and released under the PostgreSQL License, which the project describes as a liberal open source licence similar to BSD or MIT. Its versioning policy is one major release a year, minor releases at least every three months, and five years of support per major version. The current major version is PostgreSQL 18 (18.6 at the time of checking); PostgreSQL 19 was in beta (Beta 4, 24 September 2026) and is not recommended by the project for production.
Both are mature, ACID compliant engines that handle large production workloads. This page focuses on what differs: licensing, platforms, SQL dialect, concurrency defaults, high availability options, and tooling.
Side by side
| Aspect | SQL Server | PostgreSQL |
|---|---|---|
| Licence | Proprietary Microsoft licence; per core (Enterprise, Standard) or Server + CAL (Standard) | PostgreSQL License (permissive, OSI approved); no paid editions |
| Free option | Express (production allowed, with limits) and Developer (dev and test only) | The whole product, without feature or size limits imposed by licence |
| Release cadence | Major versions every few years, with cumulative updates in between | One major release a year, minor releases at least quarterly, 5 years support per major |
| Server platforms | Windows; RHEL 9 and 10, Ubuntu 22.04 and 24.04 (2025); Docker on x86-64 Linux hosts | Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD, Solaris (per the download page) |
| SQL dialect | Transact-SQL (T-SQL) | PostgreSQL SQL, with PL/pgSQL and other procedural languages |
| Default concurrency | READ COMMITTED with shared locks by default; row versioning via READ_COMMITTED_SNAPSHOT or SNAPSHOT | MVCC: reading never blocks writing and writing never blocks reading |
| JSON | Native json data type and JSON indexing in SQL Server 2025 | json and jsonb types; jsonb can be indexed with GIN indexes |
| High availability | Always On availability groups (Enterprise); basic availability groups (Standard); none in Express | Built-in streaming and logical replication; automatic failover needs external tooling |
| Managed cloud | Azure SQL Database, Azure SQL Managed Instance, Amazon RDS, Google Cloud SQL | Amazon RDS and Aurora PostgreSQL, Google Cloud SQL, and other providers |
| Main trade-off | Licence cost scales with cores; key HA features are Enterprise only | No single vendor; support, HA orchestration and some tooling come from third parties |
Key differences
Licensing and edition limits
PostgreSQL has one edition, and the licence places no limits on cores, memory or database size. SQL Server limits depend on edition. Per Microsoft's SQL Server 2025 editions page, Express is limited to the lesser of 1 socket or 4 cores, 1,410 MB of buffer pool memory per instance and 50 GB per relational database, and has no SQL Server Agent. Standard is limited to the lesser of 4 sockets or 32 cores and 256 GB of buffer pool memory (SQL Server 2022 Standard was 24 cores and 128 GB). Enterprise is limited only by the operating system. See SQL Server Express vs Standard and Standard vs Enterprise.
Platforms, including macOS
PostgreSQL publishes packages and installers for Linux distributions, macOS, Windows, the BSDs and Solaris. SQL Server 2025 runs on Windows and on Red Hat Enterprise Linux 9.x and 10.x and Ubuntu 22.04 and 24.04; SUSE Linux Enterprise Server is no longer supported from 2025. SQL Server containers are supported only on x86-64 Linux hosts, and Microsoft says emulation such as Rosetta 2 is not tested or supported. Developers on Apple silicon Macs can run PostgreSQL natively; SQL Server needs a separate x86-64 host or a cloud instance.
SQL dialect: T-SQL and PostgreSQL side by side
Standard queries port easily; the differences are in row limiting, auto-numbering, upserts, string aggregation and procedural code. Examples target SQL Server 2017 or later and PostgreSQL 15 or later.
First 10 rows
-- SQL Server (T-SQL)
SELECT TOP (10) id, name FROM customers ORDER BY name;
-- PostgreSQL
SELECT id, name FROM customers ORDER BY name LIMIT 10;
-- standard form, also accepted by PostgreSQL
SELECT id, name FROM customers ORDER BY name FETCH FIRST 10 ROWS ONLY;Auto-numbered key
-- SQL Server (T-SQL)
CREATE TABLE orders (
id INT IDENTITY(1,1) PRIMARY KEY,
total DECIMAL(10,2) NOT NULL
);
-- PostgreSQL
CREATE TABLE orders (
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
total NUMERIC(10,2) NOT NULL
);Insert or update (upsert). Both engines support MERGE (PostgreSQL added it in version 15). PostgreSQL also has INSERT ... ON CONFLICT, which needs a unique constraint or index on the conflict column.
-- SQL Server (T-SQL)
MERGE INTO stock AS t
USING (VALUES ('A1', 5)) AS s (sku, qty)
ON t.sku = s.sku
WHEN MATCHED THEN UPDATE SET t.qty = s.qty
WHEN NOT MATCHED THEN INSERT (sku, qty) VALUES (s.sku, s.qty);
-- PostgreSQL
INSERT INTO stock (sku, qty) VALUES ('A1', 5)
ON CONFLICT (sku) DO UPDATE SET qty = EXCLUDED.qty;Comma separated list per group. Both use STRING_AGG (SQL Server 2017 and later), but the ordering syntax differs.
-- SQL Server (T-SQL)
SELECT dept, STRING_AGG(name, ', ') WITHIN GROUP (ORDER BY name) AS staff
FROM employees GROUP BY dept;
-- PostgreSQL
SELECT dept, STRING_AGG(name, ', ' ORDER BY name) AS staff
FROM employees GROUP BY dept;Procedural code differs most: T-SQL batches, variables and TRY...CATCH versus PL/pgSQL functions and procedures. Budget for a rewrite of stored procedures in either direction. Our SQL functions library lists T-SQL functions with notes on other dialects.
Concurrency model
PostgreSQL uses multiversion concurrency control for all tables; its documentation states that in MVCC reading never blocks writing and writing never blocks reading. SQL Server's default READ COMMITTED level uses shared locks, and READ_COMMITTED_SNAPSHOT is OFF by default on SQL Server (ON by default in Azure SQL Database). Turning it on, or using SNAPSHOT isolation, switches reads to row versioning. Writers still take exclusive locks in both engines. If you are moving from PostgreSQL to SQL Server and expect readers not to block writers, review this setting early.
High availability, extensions and tooling
SQL Server ships its HA stack in the product, gated by edition: Always On availability groups with up to 8 secondary replicas in Enterprise, basic availability groups (two replicas, one database) in Standard, and failover cluster instances in both. PostgreSQL includes streaming and logical replication, but automatic failover and connection routing are typically handled by separate open source or vendor tools, which you must choose and operate.
PostgreSQL is designed to be extended: CREATE EXTENSION adds data types, index methods and functions, and extensions such as PostGIS are widely used. SQL Server instead builds features into the engine; SQL Server 2025 adds a native vector data type, regular expression support and a native json type across editions. For tools, Microsoft provides SSMS (Windows) and the MSSQL extension for VS Code; PostgreSQL's main admin tool is pgAdmin (Windows, macOS, Linux, or as a web app). DBeaver works with both. See PostgreSQL GUI tools and SQL Server GUI tools.
Pricing and licensing
SQL Server 2025. Listed on the vendor's pricing sheet in October 2026, in US dollars, as open no-level estimated retail prices (your reseller price may differ): Enterprise USD 15,123 per 2-core pack; Standard USD 3,945 per 2-core pack under per core licensing, or USD 989 per server plus USD 230 per client access licence (CAL) under Server + CAL. Subscriptions through volume licensing are listed at USD 5,434 per year (Enterprise) and USD 1,418 per year (Standard) per 2-core pack. Microsoft also offers pay-as-you-go billing through Azure Arc. Express and Developer are free.
PostgreSQL. Free under the PostgreSQL License for any use, including commercial use and redistribution. There is no vendor licence fee; costs come from hosting, managed services (priced by each cloud provider) and any commercial support contract you choose to buy from a third party.
Pricing checked on the vendors' official pages on 7 October 2026. Prices change; confirm before buying.
Where each one leads
SQL Server strengths
- Free Express edition for small production workloads and full featured Developer editions for dev and test
- High availability built into the product: availability groups and failover cluster instances
- SQL Server 2025 adds native json and vector data types and regular expression support in all editions
- Mature first-party tooling (SSMS, SQL Server Agent, Query Store) and a single vendor for support
- Direct path to Azure SQL Database and Azure SQL Managed Instance
PostgreSQL strengths
- Permissive PostgreSQL License with no editions, caps or licence fees
- Native builds for Linux, Windows, macOS, the BSDs and Solaris
- MVCC for all reads by default, so readers and writers do not block each other
- Extension system (for example PostGIS) and jsonb with GIN indexing
- Predictable yearly releases with five years of support per major version
Limitations
SQL Server limitations
- Express (2025) is limited to 50 GB per database, 1,410 MB buffer pool and 4 cores, with no SQL Server Agent
- Per core licensing makes large servers expensive; full availability groups need Enterprise
- No native macOS server; containers are supported only on x86-64 Linux hosts
- SSMS, the main admin tool, runs on Windows only
PostgreSQL limitations
- No vendor-backed edition: commercial support and HA orchestration come from third parties
- Automatic failover is not built in and needs extra tooling to operate
- Major version upgrades are needed at least every five years to stay supported
- Migration from T-SQL needs procedure rewrites and data type mapping
When to choose each
Choose SQL Server if
- Your applications and team are built around .NET, Windows Server and T-SQL
- You want HA, scheduling (SQL Server Agent) and tooling from one vendor with commercial support
- Your workload fits in Express today and you want a supported upgrade path
- You plan to move to Azure SQL Database or Azure SQL Managed Instance
Choose PostgreSQL if
- You want no licence cost at any scale and a permissive licence
- Developers need the server running natively on macOS or the target is Linux or BSD
- You rely on extensions such as PostGIS, or on jsonb indexing
- You want to keep options open across cloud providers and hosting companies
When neither is right
- You need an embedded database inside an application or device: SQLite is simpler than running either server. See SQLite vs MySQL.
- Your stack is PHP and web hosting where MySQL is the default: see MySQL vs PostgreSQL and MySQL vs SQL Server.
- You are standardised on Oracle Database and its tooling: compare against Oracle first. See SQL Server vs Oracle and PostgreSQL vs Oracle.
- Your data is mostly schemaless documents: see MongoDB vs PostgreSQL.
Final recommendation
Neither engine is a universal winner. PostgreSQL is the default we would recommend for new projects without a Microsoft dependency: there is no licence cost at any scale, it runs on every common platform, and its concurrency model and extensions cover a wide range of workloads. SQL Server is the better fit when you are already invested in Microsoft technology, need its built-in HA and tooling, or plan to use Azure SQL; start with Express or Developer and price the Standard or Enterprise licence for your core count before you depend on edition features.
Frequently asked questions
Is PostgreSQL really free for commercial use?
Yes. PostgreSQL is released under the PostgreSQL License, a permissive open source licence similar to BSD or MIT, with no paid editions. SQL Server is free only in its Express and Developer editions; Standard and Enterprise are paid. See SQL Server Express vs Developer.
Which is faster, SQL Server or PostgreSQL?
We have not benchmarked them, and published comparisons rarely match your workload. Schema design, indexing and query shape usually matter more than the engine. If performance decides the choice, test both with your own data and queries. Note that SQL Server edition limits (cores and memory) can cap performance on Express and Standard.
Does PostgreSQL support MERGE like SQL Server?
Yes. PostgreSQL added the SQL MERGE command in version 15, and current versions also support RETURNING on MERGE. PostgreSQL also has INSERT ... ON CONFLICT for single-table upserts.
What is the latest version of each?
In October 2026: SQL Server 2025 (17.x) with Cumulative Update 9, and PostgreSQL 18.6. PostgreSQL 19 was in beta and PostgreSQL 14 reaches end of support on 12 November 2026.
How hard is it to migrate from SQL Server to PostgreSQL?
Tables and simple queries move with type mapping and syntax changes like those shown above (TOP to LIMIT, IDENTITY to GENERATED AS IDENTITY, STRING_AGG ordering). Stored procedures, triggers and anything relying on SQL Server Agent need redesign. Plan and test the migration rather than expecting an automatic conversion.
Sources
- Microsoft Learn: Editions and supported features of SQL Server 2025
- Microsoft: SQL Server 2025 pricing sheet (PDF)
- Microsoft: SQL Server downloads (Express and Developer)
- Microsoft Learn: Release information for SQL Server on Linux
- Microsoft Learn: SET TRANSACTION ISOLATION LEVEL
- PostgreSQL versioning policy
- PostgreSQL License
- PostgreSQL downloads
- PostgreSQL documentation: MVCC introduction
- PostgreSQL documentation: MERGE
- PostgreSQL documentation: JSON types
- PostgreSQL documentation: high availability and replication
Checked October 2026.
How we research comparisons: our editorial method.