Waiting for PostgreSQL 18 – Add OLD/NEW support to RETURNING in DML queries.

Read Original

The article details a new feature committed for PostgreSQL 18 that extends the RETURNING clause in INSERT, UPDATE, DELETE, and MERGE queries. It now supports the explicit use of OLD and NEW aliases to return values from before and after the data modification, simplifying workflows that previously required complex CTEs. The post includes syntax examples and explains the feature's utility, especially for updates and maintaining backward compatibility.

Waiting for PostgreSQL 18 – Add OLD/NEW support to RETURNING in DML queries.

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week