The PostgreSQL Global Development Group released PostgreSQL 19 on November 19. The headline feature is REPACK, which cleans up a table without blocking reads and writes, but people who write queries every day will probably care more about the smaller additions: ON CONFLICT DO SELECT, IGNORE NULLS in window functions and COPY output as JSON.
What PostgreSQL 19 brings
REPACK instead of VACUUM FULL and CLUSTER
A table that sees a lot of updates and deletes slowly fills up with dead rows, which people call bloat. Until now you cleaned that up with VACUUM FULL or CLUSTER, and both locked the table until they finished. The new REPACK command reclaims the space and can reorder the data to match an index, and REPACK (CONCURRENTLY) does it without blocking reads or writes. The old commands stay for compatibility, but the release announcement is clear that REPACK replaces them.
Stable query plans
The planner usually picks a good plan, but as data grows the plan can switch to a slower one. The pg_plan_advice extension lets you pin the planner's choices and try out other plans with a small "plan advice" language. A second extension, pg_stash_advice, stores that advice and applies it automatically by query identifier, so you can fix a slow plan without touching application code.
New things for developers
The most practical change is INSERT ... ON CONFLICT DO SELECT. The RETURNING clause then gives you back the existing row that caused the conflict, so the "get or create" pattern fits in one statement with no second round trip to the database. Here is an example in the style of the INSERT documentation:
INSERT INTO users (email, name)
VALUES ('ala@example.com', 'Ala')
ON CONFLICT (email) DO SELECT
RETURNING *;On top of that, COPY can write data as JSON (including as a single array), the SQL/JSON path language gained string methods such as lower(), upper() and replace(), and the window functions lead(), lag(), first_value(), last_value() and nth_value() can skip NULL values with IGNORE NULLS. The random() function can now also produce random dates and timestamps within a range.
Replication and reads from standbys
You can now turn on logical replication without restarting the server: the effective WAL level goes up on its own when you create the first logical slot. Sequence values are replicated too (FOR ALL SEQUENCES). Applications that read from standbys get the WAIT FOR LSN command, which waits until the standby has caught up with a write from the primary, so users see what they just saved right away.
Performance and new defaults
Foreign key checks got faster: in the project's own tests, bulk inserts were nearly twice as fast. The planner turns NOT IN into a more efficient anti-join when no NULL values are involved. Three changes are worth knowing before you upgrade: JIT is now off by default, md5 password authentication prints a warning (it has been deprecated since version 18), and RADIUS support is gone. As with every major version, moving your data requires dump/restore, pg_upgrade or logical replication, as the release notes explain.
What this means if you are learning to code
If you are just starting with SQL, you can leave REPACK and query plans for later. Those are tools for people who look after large databases. ON CONFLICT is worth remembering, though, because "insert it, or fetch it if it already exists" shows up in almost every app with user accounts. Try writing it two ways first (a SELECT, then an INSERT) and compare that with the single PostgreSQL 19 statement. You will see where bugs come from when two requests arrive at the same moment.
The basics you need to follow all this (SELECT, INSERT, keys and unique constraints) are covered in our SQL course. If you want to see what PostgreSQL looks like in practice, have a look at our PostgreSQL guide.
Window functions with IGNORE NULLS are a good next step after GROUP BY. They let you take the last known reading, for example, when your data has gaps. You do not need to install version 19 right away. Almost everything you are learning now works the same way in older versions.
Also today
- PHP 8.6 is out. The new version adds partial function application (missing arguments become
?and...), a\Time\Durationclass, a Polling API for event loops, aclamp()function and default values for readonly properties. PHP 8.6 announcement - Ruby 4.0.10, 3.4.13 and 3.3.14 fix seven vulnerabilities. The bugs are in the regular expression engine and in string case conversion, and for some of them there are working proofs of concept that run code. The Ruby team recommends upgrading now. Ruby advisory
- Rails and Sinatra are exposed by default. Veria Labs wrote up one of these bugs: upcasing "Γ" writes a byte past the end of a buffer, and an attacker can reach it without logging in on an ordinary Rails app. Veria Labs write-up
- Bun v1.4.5 is a security release. It updates lsquic, c-ares, SQLite, llhttp and BoringSSL and fixes HTTP/3, TLS and DNS issues, so it affects
fetchandBun.serveamong others. Bun blog and our Bun guide - Gemini 4 Neon lands in the API. Google released a model it pitches as strong at coding; it costs 3 dollars per million input tokens and 15 dollars per million output tokens, with a 1 million token context window. Google announcement
- Tool Retrieval in the Gemini API. An agent no longer has to send every tool schema with each request: you add a
tool_searchtool, setdefer_loadingand the schemas load on demand. It is in preview in the Interactions API and works with Gemini 3.6 and later models. Google blog, with more on working with models in our Gemini guide and our AI-assisted coding course
Frequently asked questions
Should I upgrade my database to PostgreSQL 19 right away?
In production people usually wait for the first patch releases and check the incompatible changes first, such as JIT being off and the md5 warnings. For learning and new projects you can use version 19 today.
How is ON CONFLICT DO SELECT different from DO NOTHING?
DO NOTHING returns nothing on a conflict, so you need a second query to fetch the existing row. DO SELECT returns that row through RETURNING in the same statement.
Does REPACK replace regular VACUUM?
No. Plain VACUUM and autovacuum keep working as before. REPACK replaces VACUUM FULL and CLUSTER, the heavy cleanup that rewrites the whole table.
Sources
- PostgreSQL 19 Released!, PostgreSQL Global Development Group, November 19, 2026
- Release 19, PostgreSQL, November 19, 2026
- INSERT, PostgreSQL 19 documentation
- PHP 8.6 Release Announcement, PHP, November 19, 2026
- Security advisories: multiple vulnerabilities in Regexp and String case conversion, Ruby, November 18, 2026
- Ruby2Shell, Veria Labs, November 19, 2026
- Bun v1.4.5, Bun, November 19, 2026
- Introducing Gemini 4 Neon, Google, November 18, 2026
- Introducing Tool Retrieval in the Gemini API, Google, November 19, 2026
This article was prepared with the help of AI from primary sources and reviewed by the CodeWorlds editorial team.