From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers\@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: No longer possible to query catalogs for index capabilities?
Date: Fri, 12 Aug 2016 19:35:52 +0100
Message-ID: <87fuq9oo12.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <30901.1470868017@sss.pgh.pa.us>
References: <20160809155623.GA567087@alvherre.pgsql>
<87y445ap58.fsf@news-spur.riddles.org.uk>
<87a8gkr8fu.fsf@news-spur.riddles.org.uk>
<17563.1470843700@sss.pgh.pa.us>
<8737mcr3vn.fsf@news-spur.riddles.org.uk>
<30901.1470868017@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
So I'm tidying up and doing docs for the next version of this patch, but
here for comment is the current functionality:
select cap,
pg_indexam_has_property(a.oid, cap) as "AM",
pg_index_has_property('onek_hundred'::regclass, cap) as "Index",
pg_index_column_has_property('onek_hundred'::regclass, 1, cap) as "Column"
from pg_am a,
unnest(array['asc', 'desc', 'nulls_first', 'nulls_last',
'orderable', 'distance_orderable', 'can_order',
'can_unique', 'can_multi_col', 'can_exclude',
'can_backward', 'can_cluster', 'index_scan',
'bitmap_scan', 'can_return', 'search_array',
'search_nulls'])
with ordinality as u(cap,ord)
where a.amname='btree'
order by ord;
cap | AM | Index | Column
--------------------+----+-------+--------
asc | | | t
desc | | | f
nulls_first | | | f
nulls_last | | | t
orderable | | | t
distance_orderable | | | f
can_order | t | t | t
can_unique | t | t | t
can_multi_col | t | t | t
can_exclude | t | t | t
can_backward | | t | t
can_cluster | | t | t
index_scan | | t | t
bitmap_scan | | t | t
can_return | | | t
search_array | | | t
search_nulls | | | t
(17 rows)
This table shows what properties are exposed at the AM-wide level, the
per-index level and the per-column level.
distance_orderable now returns true/false depending on the opclass, not
just on the amcanorderbyop field. In order to do this, I've added an
optional amproperty function to the AM api, which if it exists, gets
first dibs on all property calls so it can override the result as it
sees fit.
can_return likewise reflects the result of index_can_return.
--
Andrew (irc:RhodiumToad)
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: andrew@tao11.riddles.org.uk, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, kgrittn@gmail.com, sfrost@snowman.net, peter.eisentraut@2ndquadrant.com, robertmhaas@gmail.com
Subject: Re: No longer possible to query catalogs for index capabilities?
In-Reply-To: <87fuq9oo12.fsf@news-spur.riddles.org.uk>
References: <20160809155623.GA567087@alvherre.pgsql> <87y445ap58.fsf@news-spur.riddles.org.uk> <87a8gkr8fu.fsf@news-spur.riddles.org.uk> <17563.1470843700@sss.pgh.pa.us> <8737mcr3vn.fsf@news-spur.riddles.org.uk> <30901.1470868017@sss.pgh.pa.us> <87fuq9oo12.fsf@news-spur.riddles.org.uk>
* 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