
Postgres 18 just shipped, and as always, it’s available in preview on Neon right away. You can try it right now on Neon’s Free plan, no credit card or setup required.
New Features in Postgres 18
Postgres 18 comes with a ton of other exciting updates around performance, flexibility, and developer experience. Here are just a few:
B-tree skip scan
Postgres 18 removes a long-standing limitation of multicolumn B-tree indexes. Previously, queries could only use such indexes efficiently if they included equality conditions on the leading column. With the new skip scan optimization, Postgres can intelligently scan across distinct values in the omitted prefix columns, enabling efficient access even when the first column is not part of the filter. This is especially useful in analytics and reporting workloads where queries often vary the combinations of indexed columns.
Improved EXPLAIN output
Query optimization becomes easier in Postgres 18 thanks to the expanded EXPLAIN ANALYZE output. Buffer usage is now included by default, eliminating the need to add BUFFERS manually, and new metrics show the number of index lookups performed. In verbose mode, additional details such as CPU usage and WAL writes are also included.
Virtual generated columns by default
In Postgres 18, you can now use generated columns without increasing the on-disk size of your table data. These virtual generated columns allow you to speed up INSERT
and UPDATE
operations, and ensures that values are always up-to-date. The associated syntax has been updated accordingly, now defaulting to virtual generated columns if no generated column type was indicated (previously, STORED
was required).
UUIDv7 support
Postgres 18 introduces native support for UUIDv7, a new RFC-standardized format that embeds a timestamp in the UUID. Unlike the random distribution of UUIDv4, UUIDv7 values are naturally ordered, which improves B-tree index performance and cache efficiency, which can be seen in better update and insert performance.
Improved RETURNING clause
The RETURNING
clause has also been expanded in Postgres 18 to make both old and new row values available in a single statement. This allows developers to capture before-and-after values during INSERT, UPDATE, DELETE, or MERGE operations without triggers or additional queries.
Temporal constraints
Postgres 18 introduces temporal integrity at the schema level with WITHOUT OVERLAPS
for primary and unique keys, and the PERIOD
clause for foreign keys. These constraints ensure that time ranges do not overlap incorrectly and that temporal relationships between tables remain consistent. Think of it like a Gantt chart – each row represents a period of validity, and temporal constraints guarantee that these “bars” on the timeline never overlap when they shouldn’t.
OAuth authentication
Authentication in Postgres 18 can now be delegated to OAuth 2.0 identity providers, such as Google, Azure AD, or Auth0. Applications and users can connect to Postgres with access tokens rather than passwords. The feature supports the device authorization flow for CLI tools as well as direct bearer tokens for applications.
NOT NULL constraints as NOT VALID
Adding a NOT NULL
constraint to a large table no longer requires an immediate full-table scan. Postgres 18 allows you to mark constraints as NOT VALID
, enforcing them for new rows immediately while deferring validation of existing data, e.g. for safer schema migrations in production.
Autovacuum maintenance configuration
Postgres 18 also refines autovacuum behavior with new insert-specific thresholds. This allows developers to configure vacuuming more precisely for workloads where inserts dominate, preventing table bloat while reducing unnecessary maintenance load.
Parallel GIN index builds
Postgres’ GIN index, which is commonly used for indexing JSON[B] fields and to power full-text-search capabilities, got a major indexing performance boost with the newly implemented support for parallel index builds. By processing table data in multiple workers, the time spent creating or reindexing a GIN index can now be significantly reduced.
And Last But Not Least: Asynchronous I/O
One of the biggest changes in Postgres 18 is the introduction of asynchronous I/O for read operations. Until now, all reads in Postgres were synchronous: queries had to wait for each read to complete before continuing. Async I/O allows Postgres to issue multiple reads at once and continue execution while waiting for the results, reducing idle CPU time and improving throughput.
Once this is available on Neon, you’ll be able to configure the I/O behavior using a new setting in postgresql.conf called io_method. This setting controls how read operations are handled internally and must be set at startup. There’s a few available options:
worker
(default): Uses a pool of background I/O workers. Read requests are enqueued by the backend process and processed in parallel by these workers, which then deliver the data into shared buffers. The number of workers can be tuned via io_workers (default is 3).io_uring
: A Linux-only method that uses a shared ring buffer with the kernel to submit and complete I/O operations directly, without spawning additional processes. It offers lower overhead and better performance, but requires a recent kernel and compatible file system.sync
: Keeps the legacy behavior from earlier Postgres versions. Reads are blocking and useposix_fadvise()
for basic prefetching, relying on OS heuristics.
This change will improve Postgres performance across the board in managed cloud environments, where storage is often network-attached and I/O latency is non-trivial.
New pg_stat_io view will be especially useful alongside the new asynchronous I/O
One cool new feature we skip from the list above is that Postgres 18 makes the pg_stat_io view more powerful by breaking down I/O activity by backend type, object, and context, making it easier to see how disk access is being performed and where bottlenecks may be – something that will complements great the new asynchronous I/O subsystem.
Thanks to the Postgres community
Postgres 18 is the result of hard work by many contributors across the community. Every release is a reminder of the depth and strength of the Postgres ecosystem, and we’re grateful to everyone who made this milestone possible.
At Neon (a Databricks company) we’re proud to contribute back. This release includes work from our own team members, Heikki Linnakangas and Matthias van de Meent.
You can try Postgres 18 today on Neon’s Free plan. Sign up here.