Re: proposal: new long psql parameter --on-error-stop

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: new long psql parameter --on-error-stop
Date: 2014-03-01 08:37:48
Message-ID: CAFj8pRCOLjG77PfiodJ0QOhOrghpLPG2jEVdH4NbwqC8kkn2rA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)dunslane(dot)net>:

>
> On 02/28/2014 04:38 PM, Tom Lane wrote:
>
>> Andrew Dunstan <andrew(at)dunslane(dot)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 Content-Type Size
help-variables-prototype.patch text/x-patch 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-03-01 11:01:15 psql: show only failed queries
Previous Message Amit Kapila 2014-03-01 07:59:18 Re: Patch: show relation and tuple infos of a lock to acquire