From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joshua D. Drake <jd@commandprompt.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: No longer possible to query catalogs for index capabilities?
Date: Mon, 25 Jul 2016 17:09:23 -0400
Message-ID: <20160725210923.GC4028@tamriel.snowman.net> (raw)
In-Reply-To: <9606.1469475284@sss.pgh.pa.us>
References: <87mvl5on7n.fsf@news-spur.riddles.org.uk>
<23668.1469454897@sss.pgh.pa.us>
<87invtolnc.fsf@news-spur.riddles.org.uk>
<25197.1469457317@sss.pgh.pa.us>
<CA+TgmoaKit0pnaAdAQJmbXH2VnXpT72=tU9u_6rvkxNPf6Rf2w@mail.gmail.com>
<8957.1469474359@sss.pgh.pa.us>
<57966867.4080801@commandprompt.com>
<9606.1469475284@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> "Joshua D. Drake" <jd@commandprompt.com> writes:
> > On 07/25/2016 12:19 PM, Tom Lane wrote:
> >> Andrew still hasn't shown a concrete
> >> example of what he needs to do and why.
>
> > I think that Andrew and other people who have commented on this thread
> > made it pretty obvious why it is useful.
>
> Both Andrew and Robert have asserted without proof that it'd be useful
> to be able to get at some of that data. Given the lack of any supporting
> evidence, it's impossible to know which data needs to be exposed, and
> that's why I find their statements insufficient. "Emulate 9.5's pg_am
> exactly" is not in the cards, and short of that I'd like to see some
> concrete reasons why we do or do not need to expose particular bits of
> data.
I believe the response to "what" is the patch which Andrew provided, and
the use-case is illustrated by the query which he wrote that used those
columns in much the same way that the JDBC driver used them (and which
was also broken by their removal). This isn't just academic "gee, I
wish we hadn't removed those columns", there are clearly cases where
they were useful and were used.
I do not believe hard-coding the name of index types as a definitive
list of which indexes support what capabilities is an appropriate
approach (as was suggested, and evidently done, for the JDBC driver).
Additional use-cases include query analysis, by which one might want to
see what capabilities an index has to understand why it may or may not
be useful for a given query. I would also suggest that relying on
pg_get_indexdef() is a poor solution and we should be considering how to
expose the necessary information for pg_dump through the catalog instead
of asking users who are interested to use a function that returns the
result as an SQL DDL statement. We don't do that for table definitions
and have argued time and time again why we shouldn't.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, tgl@sss.pgh.pa.us, jd@commandprompt.com, robertmhaas@gmail.com, andrew@tao11.riddles.org.uk
Subject: Re: No longer possible to query catalogs for index capabilities?
In-Reply-To: <20160725210923.GC4028@tamriel.snowman.net>
References: <87mvl5on7n.fsf@news-spur.riddles.org.uk> <23668.1469454897@sss.pgh.pa.us> <87invtolnc.fsf@news-spur.riddles.org.uk> <25197.1469457317@sss.pgh.pa.us> <CA+TgmoaKit0pnaAdAQJmbXH2VnXpT72=tU9u_6rvkxNPf6Rf2w@mail.gmail.com> <8957.1469474359@sss.pgh.pa.us> <57966867.4080801@commandprompt.com> <9606.1469475284@sss.pgh.pa.us> <20160725210923.GC4028@tamriel.snowman.net>
* 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