postgresql/contrib
Dean Rasheed 80feb727c8 Add OLD/NEW support to RETURNING in DML queries.
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", which are automatically added to the query (if not
already defined) while parsing its RETURNING list, allowing things
like:

  RETURNING old.colname, new.colname, ...

  RETURNING old.*, new.*

Additionally, a new syntax is supported, allowing the names "old" and
"new" to be changed to user-supplied alias names, e.g.:

  RETURNING WITH (OLD AS o, NEW AS n) o.colname, n.colname, ...

This is useful when the names "old" and "new" are already defined,
such as inside trigger functions, allowing backwards compatibility to
be maintained -- the interpretation of any existing queries that
happen to already refer to relations called "old" or "new", or use
those as aliases for other relations, is not changed.

For an INSERT, old values will generally be NULL, and for a DELETE,
new values will generally be NULL, but that may change for an INSERT
with an ON CONFLICT ... DO UPDATE clause, or if a query rewrite rule
changes the command type. Therefore, we put no restrictions on the use
of old and new in any DML queries.

Dean Rasheed, reviewed by Jian He and Jeff Davis.

Discussion: https://postgr.es/m/CAEZATCWx0J0-v=Qjc6gXzR=KtsdvAE7Ow=D=mu50AgOe+pvisQ@mail.gmail.com
2025-01-16 14:57:35 +00:00
..
amcheck Update copyright for 2025 2025-01-01 11:21:55 -05:00
auth_delay Update copyright for 2025 2025-01-01 11:21:55 -05:00
auto_explain Update copyright for 2025 2025-01-01 11:21:55 -05:00
basebackup_to_shell Update copyright for 2025 2025-01-01 11:21:55 -05:00
basic_archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
bloom Update copyright for 2025 2025-01-01 11:21:55 -05:00
bool_plperl Update copyright for 2025 2025-01-01 11:21:55 -05:00
btree_gin Update copyright for 2025 2025-01-01 11:21:55 -05:00
btree_gist Change gist stratnum function to use CompareType 2025-01-15 11:34:04 +01:00
citext Update copyright for 2025 2025-01-01 11:21:55 -05:00
cube Update copyright for 2025 2025-01-01 11:21:55 -05:00
dblink Update copyright for 2025 2025-01-01 11:21:55 -05:00
dict_int Update copyright for 2025 2025-01-01 11:21:55 -05:00
dict_xsyn Update copyright for 2025 2025-01-01 11:21:55 -05:00
earthdistance Update copyright for 2025 2025-01-01 11:21:55 -05:00
file_fdw Update copyright for 2025 2025-01-01 11:21:55 -05:00
fuzzystrmatch Update copyright for 2025 2025-01-01 11:21:55 -05:00
hstore Update copyright for 2025 2025-01-01 11:21:55 -05:00
hstore_plperl Use @extschema:name@ notation in contrib transform modules. 2025-01-09 15:16:56 -05:00
hstore_plpython Use @extschema:name@ notation in contrib transform modules. 2025-01-09 15:16:56 -05:00
intagg Update copyright for 2025 2025-01-01 11:21:55 -05:00
intarray Update copyright for 2025 2025-01-01 11:21:55 -05:00
isn Update copyright for 2025 2025-01-01 11:21:55 -05:00
jsonb_plperl Update copyright for 2025 2025-01-01 11:21:55 -05:00
jsonb_plpython Update copyright for 2025 2025-01-01 11:21:55 -05:00
lo Update copyright for 2025 2025-01-01 11:21:55 -05:00
ltree Update copyright for 2025 2025-01-01 11:21:55 -05:00
ltree_plpython Use @extschema:name@ notation in contrib transform modules. 2025-01-09 15:16:56 -05:00
oid2name Update copyright for 2025 2025-01-01 11:21:55 -05:00
pageinspect Update copyright for 2025 2025-01-01 11:21:55 -05:00
passwordcheck Add passwordcheck.min_password_length. 2025-01-07 15:06:40 -06:00
pg_buffercache Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_freespacemap pg_freespacemap: Fix declaration of pg_freespace(regclass) 2025-01-08 13:16:43 +09:00
pg_logicalinspect Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_prewarm Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_stat_statements Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_surgery Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_trgm Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_visibility Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_walinspect Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgcrypto Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgrowlocks Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgstattuple Update copyright for 2025 2025-01-01 11:21:55 -05:00
postgres_fdw Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
seg Update copyright for 2025 2025-01-01 11:21:55 -05:00
sepgsql Update copyright for 2025 2025-01-01 11:21:55 -05:00
spi Update copyright for 2025 2025-01-01 11:21:55 -05:00
sslinfo Update copyright for 2025 2025-01-01 11:21:55 -05:00
start-scripts
tablefunc Update copyright for 2025 2025-01-01 11:21:55 -05:00
tcn Update copyright for 2025 2025-01-01 11:21:55 -05:00
test_decoding Update copyright for 2025 2025-01-01 11:21:55 -05:00
tsm_system_rows Update copyright for 2025 2025-01-01 11:21:55 -05:00
tsm_system_time Update copyright for 2025 2025-01-01 11:21:55 -05:00
unaccent Update copyright for 2025 2025-01-01 11:21:55 -05:00
uuid-ossp Update copyright for 2025 2025-01-01 11:21:55 -05:00
vacuumlo Update copyright for 2025 2025-01-01 11:21:55 -05:00
xml2 Update copyright for 2025 2025-01-01 11:21:55 -05:00
contrib-global.mk
Makefile Add contrib/pg_logicalinspect. 2024-10-14 17:22:02 -07:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
README

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.