]> granicus.if.org Git - postgresql/commit
Add SQL-accessible functions for inspecting index AM properties.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 13 Aug 2016 22:31:14 +0000 (18:31 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 13 Aug 2016 22:31:14 +0000 (18:31 -0400)
commited0097e4f9e6b1227935e01fa67f12a238b66064
tree61d5e7df676a4f2f60ad6e8c5458bd5ed648ff32
parent499787819309293f3d2cd7219aee334a0e7d5069
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.fsf@news-spur.riddles.org.uk>
28 files changed:
contrib/bloom/blutils.c
doc/src/sgml/catalogs.sgml
doc/src/sgml/func.sgml
doc/src/sgml/indexam.sgml
src/backend/access/brin/brin.c
src/backend/access/gin/ginutil.c
src/backend/access/gist/gist.c
src/backend/access/gist/gistutil.c
src/backend/access/hash/hash.c
src/backend/access/index/amapi.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtutils.c
src/backend/access/spgist/spgutils.c
src/backend/catalog/index.c
src/backend/commands/opclasscmds.c
src/backend/executor/execAmi.c
src/backend/utils/adt/Makefile
src/backend/utils/adt/amutils.c [new file with mode: 0644]
src/include/access/amapi.h
src/include/access/gist_private.h
src/include/access/nbtree.h
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/test/regress/expected/amutils.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/serial_schedule
src/test/regress/sql/amutils.sql [new file with mode: 0644]