Skip site navigation (1) Skip section navigation (2)

Re: Long options for psql in 7.1.3

From: John Summerfield <pgtest(at)os2(dot)ami(dot)com(dot)au>
To: Arcady Genkin <a(dot)genkin(at)utoronto(dot)ca>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Long options for psql in 7.1.3
Date: 2001-10-05 23:56:38
Message-ID: Pine.LNX.4.33.0110060753080.2032-100000@dugite.os2.ami.com.au (view raw or flat)
Thread:
Lists: pgsql-bugs
On 4 Oct 2001, Arcady Genkin wrote:


> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>
> > >   g9genarc(at)eddie:~$ psql -h /var/pgsql --help
> > >   psql was compiled without support for long options.
> > >   Use --help for help on invocation options.
> > >
> > > I guess that it was confused by having both options at once, since
> > > "psql --help" works fine (i.e. the long options *do* work).
> >
> > While this message is confusing, it's factually correct. ;-)
> Yes, confusing it is.
>
> [...]
> > So --help was the next best (or even better IMHO) choice, and to support
> > it on all installations we had to give it some special treatment.
>
> That's fine, but IMO "psql -h /var/pgsql --help" and "psql --help"
> should either both work, or both not work.  Of course, this is not a
> huge issue, but it did make me rub my eyes (to make sure I wasn't
> seeing a ghost) the first time I've encountered it. :)
>

On a related matter, psql --help doesn't display the long forms even though they're evidently enabled:

[pgtest(at)numbat pgtest]$ psql --help
This is psql, the PostgreSQL interactive terminal.

Usage:
  psql [options] [dbname [username]]

Options:
  -a              Echo all input from script
  -A              Unaligned table output mode (-P format=unaligned)
  -c COMMAND      Run only single command (SQL or internal) and exit
  -d DBNAME       Specify database name to connect to (default: pgtest)
  -e              Echo commands sent to server
  -E              Display queries that internal commands generate
  -f FILENAME     Execute commands from file, then exit
  -F STRING       Set field separator (default: "|") (-P fieldsep=)
  -h HOSTNAME     Specify database server host (default: local socket)
  -H              HTML table output mode (-P format=html)
  -l              List available databases, then exit
  -n              Disable enhanced command line editing (readline)
  -o FILENAME     Send query results to file (or |pipe)
  -p PORT         Specify database server port (default: 5433)
  -P VAR[=ARG]    Set printing option 'VAR' to 'ARG' (see \pset command)
  -q              Run quietly (no messages, only query output)
  -R STRING       Set record separator (default: newline) (-P recordsep=)
  -s              Single step mode (confirm each query)
  -S              Single line mode (end of line terminates SQL command)
  -t              Print rows only (-P tuples_only)
  -T TEXT         Set HTML table tag attributes (width, border) (-P tableattr=)
  -U NAME         Specify database user name (default: pgtest)
  -v NAME=VALUE   Set psql variable 'NAME' to 'VALUE'
  -V              Show version information and exit
  -W              Prompt for password (should happen automatically)
  -x              Turn on expanded table output (-P expanded)
  -X              Do not read startup file (~/.psqlrc)

For more information, type "\?" (for internal commands) or "\help"
(for SQL commands) from within psql, or consult the psql section in
the PostgreSQL documentation.

Report bugs to <pgsql-bugs(at)postgresql(dot)org>.
[pgtest(at)numbat pgtest]$ psql --host
psql: option `--host' requires an argument
Try 'psql --help' for more information.
[pgtest(at)numbat pgtest]$ psql --version
psql (PostgreSQL) 7.2devel
contains support for: readline, history
Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Portions Copyright (c) 1996, Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.
[pgtest(at)numbat pgtest]$






In response to

pgsql-bugs by date

Next:From: Siim ValgeväliDate: 2001-10-06 07:48:08
Subject: Small bug report ...
Previous:From: Andreas WernitznigDate: 2001-10-05 22:37:10
Subject: Re: Bug #474: Index using problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group