Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1esrJK-0004AZ-Q0 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Mar 2018 14:41:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1esrJJ-0002iy-HS for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Mar 2018 14:41:53 +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.89) (envelope-from ) id 1esrJJ-0002ip-70 for pgsql-hackers@lists.postgresql.org; Mon, 05 Mar 2018 14:41:53 +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.89) (envelope-from ) id 1esrJG-0002bJ-Ob for pgsql-hackers@lists.postgresql.org; Mon, 05 Mar 2018 14:41:52 +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 w25EfhXu010993; Mon, 5 Mar 2018 09:41:43 -0500 From: Tom Lane To: Edmund Horner cc: Vik Fearing , Andres Freund , Peter Eisentraut , pgsql-hackers@lists.postgresql.org Subject: Re: PATCH: psql tab completion for SELECT In-reply-to: References: <882D6617-FA16-4C56-8FE0-884BCBBE5A4C@anarazel.de> <2738.1516234038@sss.pgh.pa.us> <3a919958-e508-3b66-686f-44a7937fb6e7@2ndquadrant.com> <24314.1520190408@sss.pgh.pa.us> Comments: In-reply-to Edmund Horner message dated "Mon, 05 Mar 2018 23:21:28 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10991.1520260903.1@sss.pgh.pa.us> Date: Mon, 05 Mar 2018 09:41:43 -0500 Message-ID: <10992.1520260903@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Edmund Horner writes: > On 5 March 2018 at 08:06, Tom Lane wrote: >> If people like this approach, I propose to commit this more or less >> as-is. The select-tab-completion patch would then need to be rewritten >> to use this infrastructure, but I think that should be straightforward. > My patch had 4 versions: PRE_81, PRE_90, PRE_96, and current. This > could be reformulated as > static const VersionedQuery > Query_for_list_of_selectable_functions_or_attributes[] = { > {90600, ... }, > {90000, ... }, > {80100, ... }, > {70300, ... }, > {0, NULL} > }; Right. > Is it overkill to have so many variations? Well, it's whatever you need for the purpose. We could discuss what the support cutoff is, but I doubt we'd make it any later than 8.0, so some types of catalog queries are going to need a lot of variations. > I am still just slightly unclear on where we are in relation to the > SAVEPOINT patch -- is that redundant now? I'm inclined to think it's a bit pointless, if the direction we're heading is to make the queries actually work on every server version. Issuing a savepoint would just mask failures. What would be actually useful is to be able to tab-complete even in the midst of a failed transaction block ... but savepoints as such won't get us there, and I have no good ideas about what would. regards, tom lane