Skip to content

Commit 714f785

Browse files
committed
psql \? cleanups by Ian Barwick
1 parent a9819ca commit 714f785

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

src/bin/psql/help.c

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.49 2002/03/19 02:32:21 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.50 2002/03/19 03:01:01 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "help.h"
@@ -177,7 +177,7 @@ slashUsage(void)
177177
if (pset.notty == 0 &&
178178
(pagerenv = getenv("PAGER")) &&
179179
(pagerenv[0] != '\0') &&
180-
screen_size.ws_row <= 39 &&
180+
screen_size.ws_row <= 46 &&
181181
(fout = popen(pagerenv, "w")))
182182
{
183183
usePipe = true;
@@ -189,55 +189,58 @@ slashUsage(void)
189189
fout = stdout;
190190

191191
/* if you add/remove a line here, change the row test above */
192+
/* if this " is the start of the string then it ought to end there to fit in 80 columns >> " */
192193
fprintf(fout, _(" \\a toggle between unaligned and aligned output mode\n"));
193194
fprintf(fout, _(" \\c[onnect] [DBNAME|- [USER]]\n"
194-
" connect to new database (currently \"%s\")\n"),
195+
" connect to new database (currently \"%s\")\n"),
195196
PQdb(pset.db));
196-
fprintf(fout, _(" \\C [TITLE] set table title, or unset with no title\n"));
197+
fprintf(fout, _(" \\C [STRING] set table title, or unset if none\n"));
197198
fprintf(fout, _(" \\cd [DIR] change the current working directory\n"));
198199
fprintf(fout, _(" \\copy ... perform SQL COPY with data stream to the client host\n"));
199200
fprintf(fout, _(" \\copyright show PostgreSQL usage and distribution terms\n"));
200-
fprintf(fout, _(" \\d [TABLE] describe table (or view, index, sequence)\n"));
201-
fprintf(fout, _(" \\d{t|i|s|v}... list tables/indexes/sequences/views\n"));
202-
fprintf(fout, _(" \\d{p|S|l} list access privileges, system tables, or large objects\n"));
203-
fprintf(fout, _(" \\da list aggregate functions\n"));
204-
fprintf(fout, _(" \\dd [NAME] show comment for table, type, function, or operator\n"));
205-
fprintf(fout, _(" \\dD [NAME] list domains\n"));
206-
fprintf(fout, _(" \\df list functions\n"));
207-
fprintf(fout, _(" \\do list operators\n"));
208-
fprintf(fout, _(" \\dT list data types\n"));
209-
fprintf(fout, _(" \\du [PATTERN] lists all configured users or only those that match pattern\n"));
210-
fprintf(fout, _(" \\e [FILE] edit the query buffer or file with external editor\n"));
211-
fprintf(fout, _(" \\echo TEXT write text to standard output\n"));
212-
fprintf(fout, _(" \\encoding ENCODING set client encoding\n"));
213-
fprintf(fout, _(" \\f [SEPARATOR] set field separator, or unset if none\n"));
214-
fprintf(fout, _(" \\g [FILE] send SQL command to server (and write results to file or |pipe)\n"));
215-
fprintf(fout, _(" \\h NAME help on syntax of SQL commands, * for all commands\n"));
201+
fprintf(fout, _(" \\d [NAME] describe table (or view, index, sequence)\n"));
202+
fprintf(fout, _(" \\d{t|i|s|v|S} [PATTERN]\n"));
203+
fprintf(fout, _(" list tables/indexes/sequences/views/system tables\n"));
204+
fprintf(fout, _(" \\da [PATTERN] list aggregate functions\n"));
205+
fprintf(fout, _(" \\dd [PATTERN] show comment for object\n"));
206+
fprintf(fout, _(" \\dD [PATTERN] list domains\n"));
207+
fprintf(fout, _(" \\df [PATTERN] list functions\n"));
208+
fprintf(fout, _(" \\do [NAME] list operators\n"));
209+
fprintf(fout, _(" \\dl list large objects, same as lo_list\n"));
210+
fprintf(fout, _(" \\dp [PATTERN] list table access privileges\n"));
211+
fprintf(fout, _(" \\dT [PATTERN] list data types\n"));
212+
fprintf(fout, _(" \\du [PATTERN] list users\n"));
213+
fprintf(fout, _(" \\e [FILE] edit the query buffer (or file) with external editor\n"));
214+
fprintf(fout, _(" \\echo [STRING] write string to standard output\n"));
215+
fprintf(fout, _(" \\encoding [ENCODING] show or set client encoding\n"));
216+
fprintf(fout, _(" \\f [STRING] show or set field separator for unaligned query output\n"));
217+
fprintf(fout, _(" \\g [FILE] send query buffer to server (and results to file or |pipe)\n"));
218+
fprintf(fout, _(" \\h [NAME] help on syntax of SQL commands, * for all commands\n"));
216219
fprintf(fout, _(" \\H toggle HTML output mode (currently %s)\n"),
217220
ON(pset.popt.topt.format == PRINT_HTML));
218221
fprintf(fout, _(" \\i FILE execute commands from file\n"));
219222
fprintf(fout, _(" \\l list all databases\n"));
220223
fprintf(fout, _(" \\lo_export, \\lo_import, \\lo_list, \\lo_unlink\n"
221-
" large object operations\n"));
224+
" large object operations\n"));
222225
fprintf(fout, _(" \\o FILE send all query results to file or |pipe\n"));
223-
fprintf(fout, _(" \\p show the content of the query buffer\n"));
224-
fprintf(fout, _(" \\pset VAR set table output option (VAR := {format|border|expanded|\n"
225-
" fieldsep|null|recordsep|tuples_only|title|tableattr|pager})\n"));
226+
fprintf(fout, _(" \\p show the contents of the query buffer\n"));
227+
fprintf(fout, _(" \\pset NAME [VALUE] set table output option (NAME := {format|border|expanded|\n"
228+
" fieldsep|null|recordsep|tuples_only|title|tableattr|pager})\n"));
226229
fprintf(fout, _(" \\q quit psql\n"));
227-
fprintf(fout, _(" \\qecho TEXT write text to query output stream (see \\o)\n"));
230+
fprintf(fout, _(" \\qecho [STRING] write string to query output stream (see \\o)\n"));
228231
fprintf(fout, _(" \\r reset (clear) the query buffer\n"));
229-
fprintf(fout, _(" \\s [FILE] print history or save it to file\n"));
230-
fprintf(fout, _(" \\set NAME VALUE set internal variable\n"));
232+
fprintf(fout, _(" \\s [FILE] display history or save it to file\n"));
233+
fprintf(fout, _(" \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n"));
231234
fprintf(fout, _(" \\t show only rows (currently %s)\n"),
232235
ON(pset.popt.topt.tuples_only));
233-
fprintf(fout, _(" \\T [TAG_ATTR] set HTML table tag attributes, or unset if none\n"));
236+
fprintf(fout, _(" \\T [STRING] set HTML <table>-tag attributes, or unset if none\n"));
234237
fprintf(fout, _(" \\timing toggle timing of queries (currently %s)\n"),
235238
ON(pset.timing));
236239
fprintf(fout, _(" \\unset NAME unset (delete) internal variable\n"));
237-
fprintf(fout, _(" \\w FILE write query buffer to file\n"));
240+
fprintf(fout, _(" \\w [FILE] write query buffer to file\n"));
238241
fprintf(fout, _(" \\x toggle expanded output (currently %s)\n"),
239242
ON(pset.popt.topt.expanded));
240-
fprintf(fout, _(" \\z list table access privileges\n"));
243+
fprintf(fout, _(" \\z [PATTERN] list table access privileges (same as \\dp)\n"));
241244
fprintf(fout, _(" \\! [COMMAND] execute command in shell or start interactive shell\n"));
242245

243246
if (usePipe)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy