From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Bruce Momjian <bruce@momjian.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
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: Sat, 6 Aug 2016 12:57:26 -0500
Message-ID: <e1514cae-2e94-5573-3e9e-c4a07e5f8048@BlueTreble.com> (raw)
In-Reply-To: <20160806151328.GH26927@momjian.us>
References: <4dea49ae-3110-5e97-1548-24ddf8f07c34@2ndquadrant.com>
<5265.1469584987@sss.pgh.pa.us>
<20160727022424.GL4028@tamriel.snowman.net>
<5278.1469628270@sss.pgh.pa.us>
<20160801140719.GK4028@tamriel.snowman.net>
<4456.1470061183@sss.pgh.pa.us>
<20160802195809.GE32575@momjian.us>
<878twadsp6.fsf@news-spur.riddles.org.uk>
<20160806145355.GG26927@momjian.us>
<87vazec536.fsf@news-spur.riddles.org.uk>
<20160806151328.GH26927@momjian.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 8/6/16 10:13 AM, Bruce Momjian wrote:
> On Sat, Aug 6, 2016 at 04:04:41PM +0100, Andrew Gierth wrote:
>>>>>>> "Bruce" == Bruce Momjian <bruce@momjian.us> writes:
>>
>> Bruce> Would it be helpful to output an array of strings representing
>> Bruce> the index definition?
>>
>> >> Why would that help, if the point is to enable programmatic access
>> >> to information?
>>
>> Bruce> I was thinking an array of strings would avoid problems in
>> Bruce> having to re-scan the output for tokens.
>>
>> OK, but that still leaves the issue of how to interpret each string,
>> yes?
>
> Yes, you still have to parse it, just not scan/tokenize it.
That's an improvement. For some scenarios maybe it's enough. But I also
don't see what's wrong with having the ability to probe for specific
capabilities. I've needed to do this for unit tests, and for some items
it's a real bear.
Trigger definitions are an example. I've done this in the past in unit
tests to ensure that a trigger was defined in a particular way. Some
data is available directly in the catalog, but getting at other info
would have required hard-coding knowledge of specific bit patterns into
the query. Instead of doing that I elected to parse
pg_get_triggerdef[1], but that's hardly satisfying either.
1: https://github.com/decibel/cat_tools/blob/master/sql/cat_tools.sql#L339
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461
--
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: Jim.Nasby@BlueTreble.com, bruce@momjian.us, andrew@tao11.riddles.org.uk, tgl@sss.pgh.pa.us, sfrost@snowman.net, peter.eisentraut@2ndquadrant.com, robertmhaas@gmail.com
Subject: Re: No longer possible to query catalogs for index capabilities?
In-Reply-To: <e1514cae-2e94-5573-3e9e-c4a07e5f8048@BlueTreble.com>
References: <4dea49ae-3110-5e97-1548-24ddf8f07c34@2ndquadrant.com> <5265.1469584987@sss.pgh.pa.us> <20160727022424.GL4028@tamriel.snowman.net> <5278.1469628270@sss.pgh.pa.us> <20160801140719.GK4028@tamriel.snowman.net> <4456.1470061183@sss.pgh.pa.us> <20160802195809.GE32575@momjian.us> <878twadsp6.fsf@news-spur.riddles.org.uk> <20160806145355.GG26927@momjian.us> <87vazec536.fsf@news-spur.riddles.org.uk> <20160806151328.GH26927@momjian.us> <e1514cae-2e94-5573-3e9e-c4a07e5f8048@BlueTreble.com>
* 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