postgresql/contrib
Tom Lane 47bb9db759 Get rid of the "new" and "old" entries in a view's rangetable.
The rule system needs "old" and/or "new" pseudo-RTEs in rule actions
that are ON INSERT/UPDATE/DELETE.  Historically it's put such entries
into the ON SELECT rules of views as well, but those are really quite
vestigial.  The only thing we've used them for is to carry the
view's relid forward to AcquireExecutorLocks (so that we can
re-lock the view to verify it hasn't changed before re-using a plan)
and to carry its relid and permissions data forward to execution-time
permissions checks.  What we can do instead of that is to retain
these fields of the RTE_RELATION RTE for the view even after we
convert it to an RTE_SUBQUERY RTE.  This requires a tiny amount of
extra complication in the planner and AcquireExecutorLocks, but on
the other hand we can get rid of the logic that moves that data from
one place to another.

The principal immediate benefit of doing this, aside from a small
saving in the pg_rewrite data for views, is that these pseudo-RTEs
no longer trigger ruleutils.c's heuristic about qualifying variable
names when the rangetable's length is more than 1.  That results
in quite a number of small simplifications in regression test outputs,
which are all to the good IMO.

Bump catversion because we need to dump a few more fields of
RTE_SUBQUERY RTEs.  While those will always be zeroes anyway in
stored rules (because we'd never populate them until query rewrite)
they are useful for debugging, and it seems like we'd better make
sure to transmit such RTEs accurately in plans sent to parallel
workers.  I don't think the executor actually examines these fields
after startup, but someday it might.

This is a second attempt at committing 1b4d280ea.  The difference
from the first time is that now we can add some filtering rules to
AdjustUpgrade.pm to allow cross-version upgrade testing to pass
despite all the cosmetic changes in CREATE VIEW outputs.

Amit Langote (filtering rules by me)

Discussion: https://postgr.es/m/CA+HiwqEf7gPN4Hn+LoZ4tP2q_Qt7n3vw7-6fJKOf92tSEnX6Gg@mail.gmail.com
Discussion: https://postgr.es/m/891521.1673657296@sss.pgh.pa.us
2023-01-18 13:23:57 -05:00
..
adminpack Update copyright for 2023 2023-01-02 15:00:37 -05:00
amcheck Update copyright for 2023 2023-01-02 15:00:37 -05:00
auth_delay Update copyright for 2023 2023-01-02 15:00:37 -05:00
auto_explain Update copyright for 2023 2023-01-02 15:00:37 -05:00
basebackup_to_shell Common function for percent placeholder replacement 2023-01-11 10:42:35 +01:00
basic_archive Constify the arguments of copydir.h functions 2023-01-18 08:55:26 +09:00
bloom Update copyright for 2023 2023-01-02 15:00:37 -05:00
bool_plperl Update copyright for 2023 2023-01-02 15:00:37 -05:00
btree_gin Update copyright for 2023 2023-01-02 15:00:37 -05:00
btree_gist Update copyright for 2023 2023-01-02 15:00:37 -05:00
citext New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
cube New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
dblink Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict_int Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict_xsyn Update copyright for 2023 2023-01-02 15:00:37 -05:00
earthdistance Doc: improve commentary about providing our own definitions of M_PI. 2023-01-08 16:25:33 -05:00
file_fdw Update copyright for 2023 2023-01-02 15:00:37 -05:00
fuzzystrmatch New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
hstore Update copyright for 2023 2023-01-02 15:00:37 -05:00
hstore_plperl Update copyright for 2023 2023-01-02 15:00:37 -05:00
hstore_plpython Update copyright for 2023 2023-01-02 15:00:37 -05:00
intagg Update copyright for 2023 2023-01-02 15:00:37 -05:00
intarray Update copyright for 2023 2023-01-02 15:00:37 -05:00
isn Update copyright for 2023 2023-01-02 15:00:37 -05:00
jsonb_plperl Update copyright for 2023 2023-01-02 15:00:37 -05:00
jsonb_plpython Update copyright for 2023 2023-01-02 15:00:37 -05:00
lo Update copyright for 2023 2023-01-02 15:00:37 -05:00
ltree New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
ltree_plpython Update copyright for 2023 2023-01-02 15:00:37 -05:00
oid2name Update copyright for 2023 2023-01-02 15:00:37 -05:00
old_snapshot Update copyright for 2023 2023-01-02 15:00:37 -05:00
pageinspect Update copyright for 2023 2023-01-02 15:00:37 -05:00
passwordcheck Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_buffercache Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_freespacemap Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_prewarm Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_stat_statements meson: Add two missing regress tests 2023-01-17 13:49:09 -08:00
pg_surgery Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_trgm Remove redundant grouping and DISTINCT columns. 2023-01-18 12:37:57 -05:00
pg_visibility Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_walinspect Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgcrypto New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
pgrowlocks Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgstattuple Update copyright for 2023 2023-01-02 15:00:37 -05:00
postgres_fdw Get rid of the "new" and "old" entries in a view's rangetable. 2023-01-18 13:23:57 -05:00
seg Update copyright for 2023 2023-01-02 15:00:37 -05:00
sepgsql Update copyright for 2023 2023-01-02 15:00:37 -05:00
spi Update copyright for 2023 2023-01-02 15:00:37 -05:00
sslinfo Update copyright for 2023 2023-01-02 15:00:37 -05:00
start-scripts Remove contrib/start-scripts/osx/. 2017-11-17 12:53:20 -05:00
tablefunc Update copyright for 2023 2023-01-02 15:00:37 -05:00
tcn Update copyright for 2023 2023-01-02 15:00:37 -05:00
test_decoding Update copyright for 2023 2023-01-02 15:00:37 -05:00
tsm_system_rows Update copyright for 2023 2023-01-02 15:00:37 -05:00
tsm_system_time Update copyright for 2023 2023-01-02 15:00:37 -05:00
unaccent Update copyright for 2023 2023-01-02 15:00:37 -05:00
uuid-ossp New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
vacuumlo Update copyright for 2023 2023-01-02 15:00:37 -05:00
xml2 Update copyright for 2023 2023-01-02 15:00:37 -05:00
Makefile Add contrib/pg_walinspect. 2022-04-08 00:26:44 -07:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
contrib-global.mk Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -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.