Re: No longer possible to query catalogs for index capabilities? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: No longer possible to query catalogs for index capabilities?
Date
Msg-id 4456.1470061183@sss.pgh.pa.us
Whole thread Raw
In response to Re: No longer possible to query catalogs for index capabilities?  (Stephen Frost <sfrost@snowman.net>)
Responses Re: No longer possible to query catalogs for index capabilities?  (Stephen Frost <sfrost@snowman.net>)
Re: No longer possible to query catalogs for index capabilities?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: No longer possible to query catalogs for index capabilities?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Building on the has-property approach Andrew suggested, I wonder if
>> we need something like pg_index_column_has_property(indexoid, colno,
>> propertyname) with properties like "sortable", "desc", "nulls first".

> Right, this makes sense to me.  The point which I was trying to get at
> above is that we should be able to replace most of what is provided in
> pg_get_indexdef() by using this function to rebuild the CREATE INDEX
> command- again, similar to how we build a CREATE TABLE command rather
> than simply provide a 'pg_get_tabledef()'.

Uh, what would be the point?  You're just replacing a call to one backend
function with calls to N backend functions, and creating version
dependencies and opportunities for errors of omission on the client side.
(That is, there's exactly no chance that the set of functions you'd need
to call to construct a CREATE INDEX command would stay static forever.
We keep adding new index features.)

As far as I understood Andrew's use case, he was specifically *not*
interested in a complete representation of an index definition, but
rather about whether it had certain properties that would be of
interest to query-constructing applications.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: No longer possible to query catalogs for index capabilities?
Next
From: Stephen Frost
Date:
Subject: Re: No longer possible to query catalogs for index capabilities?