Re: proposal: new long psql parameter --on-error-stop - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: new long psql parameter --on-error-stop
Date
Msg-id CAFj8pRCOLjG77PfiodJ0QOhOrghpLPG2jEVdH4NbwqC8kkn2rA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: new long psql parameter --on-error-stop  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: proposal: new long psql parameter --on-error-stop
Re: proposal: new long psql parameter --on-error-stop
List pgsql-hackers
Hello

here is a prototype:

bash-4.1$ /usr/local/pgsql/bin/psql --help-variables
List of some variables (options) for use from command line.
Complete list you find in psql section in the PostgreSQL documentation.

psql variables:
Usage:
  psql --set=NAME=VALUE
  or \set NAME VALUE in interactive mode

  AUTOCOMMIT         when is on, successful SQL command is automatically commited
  COMP_KEYWORD_CASE  determines which letter case to use when completing an SQL key word
  ECHO               all lines from input can be written to standard output
  ECHO_HIDDEN        display queries for internal commands (same as -E option)
  FETCH_COUNT        how many rows should be for one page (default 0 unlimited)
  HISTFILE           file name that be used for store history list
  HISTSIZE           the number of commands to store in the command history
  ON_ERROR_ROLLBACK  when is on, raise ROLLBACK on error automatically
  ON_ERROR_STOP      when is set, then batch execution stop immediately after error
  VERBOSITY          control verbosity of error reports [default, verbose, terse]

Printing options:
Usage:
  psql --pset=NAME[=VALUE]
  or \pset NAME [VALUE] in interactive mode

  border             number of border style
  fieldsep           specify field separator for unaligned output
  fieldsep_zero      field separator in unaligned mode will be zero
  format             set output format [unaligned, aligned, wrapped, html, latex, ..]
  linestyle          sets the border line drawing style [ascii, old-ascii, unicode]
  null               sets the string to be printed in place of a null value
  pager              when the pager option is off, the pager program is not used
  recordsep          specifies the record (line) separator to use in unaligned output format
  recordsep_zero     record separator be in unaligned output format a zero byte
  title              sets the table title for any subsequently printed tables
  tuples_only        in tuples-only mode, only actual table data is shown

Environment options:
Usage:
  NAME=VALUE, [NAME=VALUE] psql ...
  or \setenv NAME [VALUE] in interactive mode

  COLUMNS            number of columns for wrapped format
  PAGER              used pager
  PGHOST             same as the host connection parameter
  PGDATABASE         same as the dbname connection parameter
  PGUSER             same as the user connection parameter
  PGPASSWORD         possibility to set password
  PSQL_EDITOR, EDITOR, VISUAL  editor used by \e \ef commands
  PSQL_EDITOR_LINE_NUMBER_ARG  style how to line number is used in editor
  PSQL_HISTORY       alternative location for the command history file
  PSQL_RC            alternative location of the user's .psqlrc file
  SHELL              command executed by the \! command
  TMPDIR             directory for storing temporary files

For more information consult the psql section in the PostgreSQL
documentation.

Regards

Pavel



2014-02-28 23:01 GMT+01:00 Andrew Dunstan <andrew@dunslane.net>:

On 02/28/2014 04:38 PM, Tom Lane wrote:
Andrew Dunstan <andrew@dunslane.net> writes:
Well, then we just have to add more info to --help
+1 for at least doing that. I found it annoying just the other day not
to find it in plsql's --help output, in a moment of brain fade when I
forgot how to spell it. So it's not just beginners who can benefit, it's
people like me whose memory occasionally goes awry.
No objection in principle, but what are we talking about exactly?
Adding some new backslash command that lists all the variables that have
special meanings?


That's a pretty good idea, especially if we give that command a command line option too, so something like

   psql --special-variables

would run that command and exit.

Maybe I'm over-egging the pudding a bit ;-)

cheers

andrew

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Patch: show relation and tuple infos of a lock to acquire
Next
From: Pavel Stehule
Date:
Subject: psql: show only failed queries