Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebxjw-0001Ql-Bo for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jan 2018 00:07:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebxjv-0002qH-8c for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jan 2018 00:07:31 +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 1ebxjv-0002q7-1p; Thu, 18 Jan 2018 00:07:31 +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.89) (envelope-from ) id 1ebxjn-0004Q2-JL; Thu, 18 Jan 2018 00:07:30 +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 w0I07ItZ002739; Wed, 17 Jan 2018 19:07:18 -0500 From: Tom Lane To: Edmund Horner cc: Andres Freund , pgsql-hackers@lists.postgresql.org, pgsql-hackers@postgresql.org Subject: Re: PATCH: psql tab completion for SELECT In-reply-to: References: <882D6617-FA16-4C56-8FE0-884BCBBE5A4C@anarazel.de> Comments: In-reply-to Edmund Horner message dated "Thu, 18 Jan 2018 10:47:11 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2737.1516234038.1@sss.pgh.pa.us> Date: Wed, 17 Jan 2018 19:07:18 -0500 Message-ID: <2738.1516234038@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Edmund Horner writes: > On 15 January 2018 at 15:45, Andres Freund wrote: >> All worries like this are supposed to check the server version. > In psql there are around 200 such tab completion queries, none of > which checks the server version. Many would cause the user's > transaction to abort if invoked on an older server. Identifying the > appropriate server versions for each one would be quite a bit of work. > Is there a better way to make this more robust? Maybe it'd be worth the effort to wrap tab completion queries in SAVEPOINT/RELEASE SAVEPOINT if we're inside a user transaction (which we could detect from libpq's state, I believe). That seems like an independent patch, but it'd be a prerequisite if you want to issue tab completion queries with version dependencies. A bigger point here is: do you really want SELECT tab completion to work only against the latest and greatest server version? That would become an argument against committing the feature at all; maybe not enough to tip the scales against it, but still a demerit. regards, tom lane