pgsql: Add SQL-accessible functions for inspecting index AM properties.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add SQL-accessible functions for inspecting index AM properties.
Date: 2016-08-13 22:31:30
Message-ID: E1bYhSk-0006B0-2z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add SQL-accessible functions for inspecting index AM properties.

Per discussion, we should provide such functions to replace the lost
ability to discover AM properties by inspecting pg_am (cf commit
65c5fcd35). The added functionality is also meant to displace any code
that was looking directly at pg_index.indoption, since we'd rather not
believe that the bit meanings in that field are part of any client API
contract.

As future-proofing, define the SQL API to not assume that properties that
are currently AM-wide or index-wide will remain so unless they logically
must be; instead, expose them only when inquiring about a specific index
or even specific index column. Also provide the ability for an index
AM to override the behavior.

In passing, document pg_am.amtype, overlooked in commit 473b93287.

Andrew Gierth, with kibitzing by me and others

Discussion: <87mvl5on7n(dot)fsf(at)news-spur(dot)riddles(dot)org(dot)uk>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ed0097e4f9e6b1227935e01fa67f12a238b66064

Modified Files
--------------
contrib/bloom/blutils.c | 1 +
doc/src/sgml/catalogs.sgml | 29 ++-
doc/src/sgml/func.sgml | 165 ++++++++++++++
doc/src/sgml/indexam.sgml | 50 +++++
src/backend/access/brin/brin.c | 1 +
src/backend/access/gin/ginutil.c | 1 +
src/backend/access/gist/gist.c | 1 +
src/backend/access/gist/gistutil.c | 100 +++++++++
src/backend/access/hash/hash.c | 1 +
src/backend/access/index/amapi.c | 27 ++-
src/backend/access/nbtree/nbtree.c | 1 +
src/backend/access/nbtree/nbtutils.c | 26 +++
src/backend/access/spgist/spgutils.c | 1 +
src/backend/catalog/index.c | 2 +-
src/backend/commands/opclasscmds.c | 6 +-
src/backend/executor/execAmi.c | 2 +-
src/backend/utils/adt/Makefile | 2 +-
src/backend/utils/adt/amutils.c | 390 ++++++++++++++++++++++++++++++++++
src/include/access/amapi.h | 36 +++-
src/include/access/gist_private.h | 3 +
src/include/access/nbtree.h | 3 +
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.h | 11 +-
src/include/utils/builtins.h | 5 +
src/test/regress/expected/amutils.out | 208 ++++++++++++++++++
src/test/regress/parallel_schedule | 2 +-
src/test/regress/serial_schedule | 1 +
src/test/regress/sql/amutils.sql | 87 ++++++++
28 files changed, 1146 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-08-14 02:25:09 pgsql: Fix assorted bugs in contrib/bloom.
Previous Message Tom Lane 2016-08-13 00:52:27 pgsql: Fix regression test parallel-make hazard.