Re: PATCH: psql tab completion for SELECT

Edmund Horner <ejrh00@gmail.com>

From: Edmund Horner <ejrh00@gmail.com>
To: pgsql-hackers@postgresql.org
Date: 2018-01-15T01:12:37Z
Lists: pgsql-hackers

Attachments

And here's a patch to add savepoint protection for tab completion.

It could definitely use some scrutiny to make sure it's not messing up
the user's transaction.

I added some error checking for the savepoint creation and the
rollback, and then wrapped it in #ifdef NOT_USED (just as the query
error checking is) as I wasn't sure how useful it is for normal use.

But I do feel that if psql unexpectedly messes up the transaction, it
should report it somehow.  How can we tell that we've messed it up for
the user?

Cheers,
Edmund

Commits

  1. In psql, restore old behavior of Query_for_list_of_functions.

  2. Add infrastructure to support server-version-dependent tab completion.