psql --help=variables lists variables that can't be set - Mailing list pgsql-hackers

From Peter Eisentraut
Subject psql --help=variables lists variables that can't be set
Date
Msg-id 566103AF.1040507@gmx.net
Whole thread Raw
Responses Re: psql --help=variables lists variables that can't be set  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: psql --help=variables lists variables that can't be set  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
psql --help=variables shows variables treated specially by psql.  And it
tells you

Usage: psql --set=NAME=VALUE or \set NAME VALUE

But some of the variables listed cannot usefully be set, only read, such as
 DBNAME             the currently connected database name HOST               the currently connected database server
LASTOID           the value of last affected OID
 

These can be read in a script, but there is nothing useful you can do
with them on the command line.

Also, for variables such as HISTCONTROL, IGNOREEOF, PROMPT*, they are
more commonly set in psqlrc, not on the command line.

Should we trim this list down to variables that are actually useful to
set on the command line?

I also have some concerns about the listed environment variables.  The
list of libpq PG* variables is incomplete, and if we're going to curate
the list, we surely don't need to show the "not recommended" PGPASSWORD
variable.

That list probably also needs some ifdefs, since SHELL and TMPDIR don't
work on Windows, and PSQL_HISTORY only works when readline support is built.



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Remaining 9.5 open items
Next
From: Michael Paquier
Date:
Subject: PostgresNode::_update_pid using undefined variables in tap tests