postgresql/contrib
Michael Paquier e7bff46e50 pageinspect: Fix gist_page_items() with included columns
Non-leaf pages of GiST indexes contain key attributes, leaf pages
contain both key and non-key attributes, and gist_page_items() ignored
the handling of non-key attributes.  This caused a few problems when
using gist_page_items() on a GiST index with INCLUDE:
- On a non-leaf page, the function would crash.
- On a leaf page, the function would work, but miss to display all the
values for included attributes.

This commit fixes gist_page_items() to handle such cases in a more
appropriate way, and now displays the values of key and non-key
attributes for each item separately in a style consistent with what
ruleutils.c would generate for the attribute list, depending on the page
type dealt with.  In a way similar to how a record is displayed, values
would be double-quoted for key or non-key attributes if required.

ruleutils.c did not provide a routine able to control if non-key
attributes should be displayed, so an extended() routine for index
definitions is added to work around the leaf and non-leaf page
differences.

While on it, this commit fixes a third problem related to the amount of
data reported for key attributes.  The code originally relied on
BuildIndexValueDescription() (used for error reports on constraints)
that would not print all the data stored in the index but the index
opclass's input type, so this limited the amount of information
available.  This switch makes gist_page_items() much cheaper as there is
no need to run ACL checks for each item printed, which is not an issue
anyway as superuser rights are required to execute the functions of
pageinspect.  Opclasses whose data cannot be displayed can rely on
gist_page_items_bytea().

The documentation of this function was slightly incorrect for the
output results generated on HEAD and v15, so adjust it on these
branches.

Author: Alexander Lakhin, Michael Paquier
Discussion: https://postgr.es/m/17884-cb8c326522977acb@postgresql.org
Backpatch-through: 14
2023-05-19 12:37:58 +09:00
..
adminpack Use "data directory" not "current directory" in error messages. 2023-03-16 12:04:08 -04:00
amcheck Fix typos in comments 2023-05-02 12:23:08 +09:00
auth_delay Fix copy-pasto in contrib/auth_delay/meson.build variable name. 2023-04-02 09:31:10 -07:00
auto_explain Make auto_explain print the query identifier in verbose mode 2023-01-26 12:23:16 +09:00
basebackup_to_shell Fix various typos and incorrect/outdated name references 2023-04-19 13:50:33 +12:00
basic_archive Redesign archive modules 2023-02-17 14:26:42 +09:00
bloom Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12: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 Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
citext Use ICU by default at initdb time. 2023-03-09 10:52:41 -08:00
cube Rework pg_input_error_message(), now renamed pg_input_error_info() 2023-02-28 08:04:13 +09:00
dblink De-Revert "Add support for Kerberos credential delegation" 2023-04-13 08:55:07 -04: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 Improve several permission-related error messages. 2023-03-17 10:33:09 +01:00
fuzzystrmatch Ensure Soundex difference() function handles empty input sanely. 2023-05-16 10:53:42 -04:00
hstore Rework pg_input_error_message(), now renamed pg_input_error_info() 2023-02-28 08:04:13 +09:00
hstore_plperl Update copyright for 2023 2023-01-02 15:00:37 -05:00
hstore_plpython In hstore_plpython, avoid crashing when return value isn't a mapping. 2023-04-27 11:55:06 -04:00
intagg Update copyright for 2023 2023-01-02 15:00:37 -05:00
intarray Fix typos in comments 2023-05-02 12:23:08 +09:00
isn Rework pg_input_error_message(), now renamed pg_input_error_info() 2023-02-28 08:04:13 +09: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 Validate ltree siglen GiST option to be int-aligned 2023-04-23 14:30:09 +03:00
ltree_plpython Update copyright for 2023 2023-01-02 15:00:37 -05:00
oid2name Mark options as deprecated in usage output 2023-03-02 14:36:37 +01:00
old_snapshot Update copyright for 2023 2023-01-02 15:00:37 -05:00
pageinspect pageinspect: Fix gist_page_items() with included columns 2023-05-19 12:37:58 +09:00
passwordcheck Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_buffercache Add pg_buffercache_usage_counts() to contrib/pg_buffercache. 2023-04-07 14:25:53 -04:00
pg_freespacemap Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_prewarm Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12:00
pg_stat_statements Fix row tracking in pg_stat_statements with extended query protocol 2023-04-06 09:29:03 +09:00
pg_surgery Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
pg_trgm Update contrib/trgm_regexp's memory management. 2023-04-08 22:09:17 +12:00
pg_visibility Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_walinspect Fix various typos and incorrect/outdated name references 2023-04-19 13:50:33 +12: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 Fix buffer refcount leak with FDW bulk inserts 2023-04-25 09:42:19 +09:00
seg Replace last PushOverrideSearchPath() call with set_config_option(). 2023-05-08 06:14:07 -07:00
sepgsql Adjust sepgsql expected output for 681d9e462 et al. 2023-05-08 11:24:47 -04: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 gratuitous references to postmaster program 2023-01-26 10:48:32 +01: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 Fix some typos and some incorrectly duplicated words 2023-04-18 14:03:49 +12: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 Fix t_isspace(), etc., when datlocprovider=i and datctype=C. 2023-03-17 12:08:46 -07: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 Revert "Rename contrib module basic_archive to basic_wal_module" 2023-01-26 09:13:39 +09: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 Revert "Rename contrib module basic_archive to basic_wal_module" 2023-01-26 09:13:39 +09: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.