Re: PATCH: psql tab completion for SELECT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PATCH: psql tab completion for SELECT
Date
Msg-id 12114.1520262270@sss.pgh.pa.us
Whole thread Raw
In response to Re: PATCH: psql tab completion for SELECT  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Mar 5, 2018 at 7:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> ​Why not have psql open two sessions to the backend, one with
> application_name 'psql_user' and one with application name "psql_​meta" (or
> some such) and have all these queries executed on the psql_meta connection?

If we did it like that, tab completion would fail to see the session's
temp tables, or objects created in the current open transaction.

People might bitch about using twice as many connections, too, although
likely you could finesse that by only opening the second connection if
tab completion actually happens (so that only interactive sessions have
one).  Still, the local-objects problem seems like a fatal objection.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)
Next
From: Tom Lane
Date:
Subject: Re: get_actual_variable_range vs idx_scan/idx_tup_fetch, again