Re: PATCH: psql tab completion for SELECT
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Edmund Horner <ejrh00@gmail.com>
Cc: Vik Fearing <vik.fearing@2ndquadrant.com>,
Andres Freund <andres@anarazel.de>,
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
pgsql-hackers@lists.postgresql.org
Date: 2018-03-05T14:41:43Z
Lists: pgsql-hackers
Edmund Horner <ejrh00@gmail.com> writes:
> On 5 March 2018 at 08:06, Tom Lane <tgl@sss.pgh.pa.us> 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
Commits
-
In psql, restore old behavior of Query_for_list_of_functions.
- b6e132ddc860 11.0 landed
-
Add infrastructure to support server-version-dependent tab completion.
- 722408bcd1bd 11.0 landed