pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add SQL-accessible functions for inspecting index AM properties.
Date: Sat, 13 Aug 2016 22:31:30 +0000
Message-ID: <E1bYhSk-0006B0-2z@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.fsf@news-spur.riddles.org.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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1bYhSk-0006B0-2z@gemulon.postgresql.org>
Permalink:  ../E1bYhSk-0006B0-2z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bYhSk-0006B0-2z@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Add SQL-accessible functions for inspecting index AM properties.
  In-Reply-To: <E1bYhSk-0006B0-2z@gemulon.postgresql.org>
  References: <E1bYhSk-0006B0-2z@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox