From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Edmund Horner <ejrh00(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org,pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: PATCH: psql tab completion for SELECT |
Date: | 2018-01-15 02:45:18 |
Message-ID: | 882D6617-FA16-4C56-8FE0-884BCBBE5A4C@anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On January 14, 2018 5:44:01 PM PST, Edmund Horner <ejrh00(at)gmail(dot)com> wrote:
>On 15 January 2018 at 14:20, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> On January 14, 2018 5:12:37 PM PST, Edmund Horner <ejrh00(at)gmail(dot)com>
>wrote:
>>>And here's a patch to add savepoint protection for tab completion.
>>
>> It'd be good to explain what that means, so people don't have to read
>the patch to be able to discuss whether this is a good idea.
>
>
>Good idea.
>
>In psql if you have readline support and press TAB, psql will often
>run a DB query to get a list of possible completions to type on your
>current command line.
>
>It uses the current DB connection for this, which means that if the
>tab completion query fails (e.g. because psql is querying catalog
>objects that doesn't exist in your server), the current transaction
>(if any) fails. An example of this happening is:
Ah, that's what I thought. I don't think this is the right fix.
> pg_subscription table doesn't
>exist on 9.2! User realises their mistake and types a different
>command)
>
> postgres=# select * from foo;
> ERROR: current transaction is aborted, commands ignored until end
>of transaction block
All worries like this are supposed to check the server version.
Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2018-01-15 04:25:25 | Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation) |
Previous Message | Stephen Frost | 2018-01-15 02:42:30 | Re: [PATCH] Atomic pgrename on Windows |