Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSEBn-00067R-9e for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Jul 2016 02:03:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bSEBl-0002Oe-KI for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Jul 2016 02:03:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSEBk-0002Nv-AO for pgsql-hackers@postgresql.org; Wed, 27 Jul 2016 02:03:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSEBh-0007Fl-Kt for pgsql-hackers@postgresql.org; Wed, 27 Jul 2016 02:03:11 +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 u6R237Wc005266; Tue, 26 Jul 2016 22:03:07 -0400 From: Tom Lane To: Peter Eisentraut cc: Andrew Gierth , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: No longer possible to query catalogs for index capabilities? In-reply-to: <4dea49ae-3110-5e97-1548-24ddf8f07c34@2ndquadrant.com> 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> <8957.1469474359@sss.pgh.pa.us> <8737mxo747.fsf@news-spur.riddles.org.uk> <4dea49ae-3110-5e97-1548-24ddf8f07c34@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Tue, 26 Jul 2016 21:34:34 -0400" Date: Tue, 26 Jul 2016 22:03:07 -0400 Message-ID: <5265.1469584987@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) 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 Peter Eisentraut writes: > On 7/25/16 3:26 PM, Andrew Gierth wrote: >> The issue I ran into was the exact same one as in the JDBC thread I >> linked to earlier: correctly interpreting pg_index.indoption (to get the >> ASC / DESC and NULLS FIRST/LAST settings), which requires knowing >> whether amcanorder is true to determine whether to look at the bits at >> all. > Maybe we should provide a facility to decode those bits then? Yeah. I'm not very impressed by the underlying assumption that it's okay for client-side code to hard-wire knowledge about what indoption bits mean, but not okay for it to hard-wire knowledge about which index AMs use which indoption bits. There's something fundamentally wrong in that. We don't let psql or pg_dump look directly at indoption, so why would we think that third-party client-side code should do so? Andrew complained upthread that pg_get_indexdef() was too heavyweight for his purposes, but it's not clear to me what he wants instead. 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