Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUE4M-0001hA-PD for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Aug 2016 14:19:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bUE4M-0006Sl-Bt for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Aug 2016 14:19:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bUE4L-0006S0-E1 for pgsql-hackers@postgresql.org; Mon, 01 Aug 2016 14:19:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bUE4I-0002rN-JD for pgsql-hackers@postgresql.org; Mon, 01 Aug 2016 14:19:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u71EJhK8004457; Mon, 1 Aug 2016 10:19:43 -0400 From: Tom Lane To: Stephen Frost cc: Peter Eisentraut , Andrew Gierth , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: No longer possible to query catalogs for index capabilities? In-reply-to: <20160801140719.GK4028@tamriel.snowman.net> References: <23668.1469454897@sss.pgh.pa.us> <87invtolnc.fsf@news-spur.riddles.org.uk> <25197.1469457317@sss.pgh.pa.us> <8957.1469474359@sss.pgh.pa.us> <8737mxo747.fsf@news-spur.riddles.org.uk> <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> Comments: In-reply-to Stephen Frost message dated "Mon, 01 Aug 2016 10:07:19 -0400" Date: Mon, 01 Aug 2016 10:19:43 -0400 Message-ID: <4456.1470061183@sss.pgh.pa.us> X-Pg-Spam-Score: -3.1 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Stephen Frost 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers