On Thu, May 8, 2025 at 03:45:00PM +0800, jian he wrote: > On Fri, May 2, 2025 at 10:44 AM Bruce Momjian <br...@momjian.us> wrote: > > > > release-18: 209 > > > > I will continue improving it until beta 1, and until the final release. > > I will probably add markup in 1-3 weeks. Let the feedback begin. ;-) > > > > You can see the most current HTML-built version here: > > > > https://momjian.us/pgsql_docs/release-18.html > > > > hi. > > Add OLD/NEW support to RETURNING in DML queries (Dean Rasheed) § > > Previously RETURNING only returned new values for INSERT and UPDATE, old > values > for DELETE; MERGE would return the appropriate value for the internal query > executed. This new syntax allows INSERT with an ON CONFLICT action to return > old > values, UPDATE to return old values, and DELETE to return new values if the > query assigned to an ON DELETE row would return new values. New syntax allows > changeable relation aliases "old" and "new" to specify which values should be > returned. > -------------------------------------------------------- > I am not sure I understand the last sentence, especially "changeable > relation aliases". > looking at the commit message, the following is what i come up with: > > Previously RETURNING only returned new values for INSERT and UPDATE, old > values > for DELETE; MERGE would return the appropriate value for the internal query > executed. This allows the RETURNING list of INSERT/UPDATE/DELETE/MERGE > queries > to explicitly return old and new values by using the special aliases "old" and > "new". There are no restrictions on the use of "old" and "new" in any DML > queries.
Yes, I like your new text better than mine. I retained "This new syntax" so "This" is clear, and adjusted the last sentence to connect the alias with the ability to rename to avoid conflicts. Applied patch attached. -- Bruce Momjian <br...@momjian.us> https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.
diff --git a/doc/src/sgml/release-18.sgml b/doc/src/sgml/release-18.sgml index 4f45c90d7d2..662a74f452c 100644 --- a/doc/src/sgml/release-18.sgml +++ b/doc/src/sgml/release-18.sgml @@ -1432,9 +1432,9 @@ Add OLD/NEW support to RETURNING in DML queries (Dean Rasheed) </para> <para> -Previously RETURNING only returned new values for INSERT and UPDATE, old values for DELETE; MERGE would return the appropriate value for the internal query executed. This new syntax -allows INSERT with an ON CONFLICT action to return old values, UPDATE to return old values, and DELETE to return new values if the query assigned to an ON DELETE row would return new -values. New syntax allows changeable relation aliases "old" and "new" to specify which values should be returned. +Previously RETURNING only returned new values for INSERT and UPDATE, and old values for DELETE; MERGE would return the appropriate value for the internal query executed. This new syntax +allows the RETURNING list of INSERT/UPDATE/DELETE/MERGE to explicitly return old and new values by using the special aliases "old" and "new". These aliases can be renamed to +avoid identifier conflicts. </para> </listitem>