pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik.fearing@2ndquadrant.com>
To: Edmund Horner <ejrh00@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: PATCH: psql tab completion for SELECT
Date: Fri, 26 Jan 2018 01:44:12 +0100
Message-ID: <cbd1e86b-88c9-edc1-8a88-66df58d8cd39@2ndquadrant.com> (raw)
In-Reply-To: <CAMyN-kDBXUAmoRb1oYaSMQDUA3=xccEzQncRBMywt4KodPdwTw@mail.gmail.com>
References: <CAMyN-kB_xrU4iYdcF1j=tijgO1DSyjtb3j96O4UEj91XZrZcMg@mail.gmail.com>
	<CAMyN-kCr6aUFaE=ov+_r=b4nS_ihtmJ8-MLMoomZGWdNFgMaVw@mail.gmail.com>
	<F9466A55-8F16-4DC2-BAE8-6386870A3C3C@anarazel.de>
	<CAMyN-kC65Xdn3Y5A+muYWMAR50gk-oCABcyZ809wuV0x9_nsJQ@mail.gmail.com>
	<882D6617-FA16-4C56-8FE0-884BCBBE5A4C@anarazel.de>
	<CAMyN-kAJX9fkzm1aFE5sp4se9t1c+p1e1JJGc_MXerxHUK9qoQ@mail.gmail.com>
	<2738.1516234038@sss.pgh.pa.us>
	<3a919958-e508-3b66-686f-44a7937fb6e7@2ndquadrant.com>
	<CAMyN-kDBXUAmoRb1oYaSMQDUA3=xccEzQncRBMywt4KodPdwTw@mail.gmail.com>

On 01/26/2018 01:28 AM, Edmund Horner wrote:
> On 19 January 2018 at 05:37, Vik Fearing <vik.fearing@2ndquadrant.com> wrote:
>> On 01/18/2018 01:07 AM, Tom Lane wrote:
>>> Edmund Horner <ejrh00@gmail.com> writes:
>>>> On 15 January 2018 at 15:45, Andres Freund <andres@anarazel.de> 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.
>>
>> I don't really want such a patch.  I use new psql on old servers all the
>> time.
> 
> I'm not sure where we got with this.  I really should have put this
> patch in a separate thread, since it's an independent feature.

Yes, it should have been a separate thread.

> The patch mentioned attempts to put savepoints around the tab
> completion query where appropriate.

I am -1 on this idea.
-- 
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support




view thread (47+ messages)  latest in thread

Message-ID: <cbd1e86b-88c9-edc1-8a88-66df58d8cd39@2ndquadrant.com>
Permalink:  ../cbd1e86b-88c9-edc1-8a88-66df58d8cd39@2ndquadrant.com/
Also on:    postgresql.org/message-id/cbd1e86b-88c9-edc1-8a88-66df58d8cd39@2ndquadrant.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: vik.fearing@2ndquadrant.com, ejrh00@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: PATCH: psql tab completion for SELECT
  In-Reply-To: <cbd1e86b-88c9-edc1-8a88-66df58d8cd39@2ndquadrant.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