PostgreSQL 18 RETURNING Enhancements: A Game Changer for Modern Applications
I make use of RETURNING heavily when writing Postgres-based worker queues. It allows me to claim a job and immediately scan the returned row into a struct, unmarshall the payload based on the operation type, and dispatch it without a second round-trip to the database.