Skip to content

Commit 2a3d7bc

Browse files
committed
blog: update what is new in pg 18
1 parent 852af53 commit 2a3d7bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

content/blog/what-is-new-in-postgres-18.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ Even when a `NOT NULL` constraint is added as `NOT VALID`, it still prevents new
6969

7070
**DBA Note:** This is a godsend for those of us managing large production databases where downtime is measured in dollars per second. No more scheduling 3 AM maintenance windows just to add a NOT NULL constraint to that 10TB table. The fact that it still prevents new NULLs while being marked as invalid is the perfect balance – forward data integrity without the immediate validation pain.
7171

72+
<HintBlock>
73+
74+
Before Postgres 18, you an use a less intuitive `CHECK (column is NOT NULL) NOT VALID`.
75+
76+
</HintBlock>
77+
7278
## OLD/NEW values in RETURNING
7379

7480
Previously, RETURNING had limitations: it typically returned new values for INSERT and UPDATE, and old values for DELETE. MERGE operations would return values based on the internal query executed. The new syntax is more flexible, allowing INSERT ON CONFLICT to return old values, UPDATE to return old values (previously only new), and DELETE to potentially return new values if an ON DELETE row assignment would produce them. This is facilitated by changeable relation aliases "old" and "new" to specify which values are desired.

0 commit comments

Comments
 (0)