359{
361 int nlcount;
363
364
365
366
367
369
370 HELP0(
"List of specially treated variables\n\n");
371
372 HELP0(
"psql variables:\n");
374 HELP0(
" psql --set=NAME=VALUE\n or \\set NAME VALUE inside psql\n\n");
375
376 HELP0(
" AUTOCOMMIT\n"
377 " if set, successful SQL commands are automatically committed\n");
378 HELP0(
" COMP_KEYWORD_CASE\n"
379 " determines the case used to complete SQL key words\n"
380 " [lower, upper, preserve-lower, preserve-upper]\n");
382 " the currently connected database name\n");
384 " controls what input is written to standard output\n"
385 " [all, errors, none, queries]\n");
386 HELP0(
" ECHO_HIDDEN\n"
387 " if set, display internal queries executed by backslash commands;\n"
388 " if set to \"noexec\", just show them without execution\n");
390 " current client character set encoding\n");
392 " \"true\" if last query failed, else \"false\"\n");
393 HELP0(
" FETCH_COUNT\n"
394 " the number of result rows to fetch and display at a time (0 = unlimited)\n");
395 HELP0(
" HIDE_TABLEAM\n"
396 " if set, table access methods are not displayed\n");
397 HELP0(
" HIDE_TOAST_COMPRESSION\n"
398 " if set, compression methods are not displayed\n");
399 HELP0(
" HISTCONTROL\n"
400 " controls command history [ignorespace, ignoredups, ignoreboth]\n");
402 " file name used to store the command history\n");
404 " maximum number of commands to store in the command history\n");
406 " the currently connected database server host\n");
408 " number of EOFs needed to terminate an interactive session\n");
410 " value of the last affected OID\n");
411 HELP0(
" LAST_ERROR_MESSAGE\n"
412 " LAST_ERROR_SQLSTATE\n"
413 " message and SQLSTATE of last error, or empty string and \"00000\" if none\n");
414 HELP0(
" ON_ERROR_ROLLBACK\n"
415 " if set, an error doesn't stop a transaction (uses implicit savepoints)\n");
416 HELP0(
" ON_ERROR_STOP\n"
417 " stop batch execution after error\n");
419 " server port of the current connection\n");
421 " specifies the standard psql prompt\n");
423 " specifies the prompt used when a statement continues from a previous line\n");
425 " specifies the prompt used during COPY ... FROM STDIN\n");
427 " run quietly (same as -q option)\n");
429 " number of rows returned or affected by last query, or 0\n");
430 HELP0(
" SERVER_VERSION_NAME\n"
431 " SERVER_VERSION_NUM\n"
432 " server's version (in short string or numeric format)\n");
433 HELP0(
" SHELL_ERROR\n"
434 " \"true\" if the last shell command failed, \"false\" if it succeeded\n");
435 HELP0(
" SHELL_EXIT_CODE\n"
436 " exit status of the last shell command\n");
437 HELP0(
" SHOW_ALL_RESULTS\n"
438 " show all results of a combined query (\\;) instead of only the last\n");
439 HELP0(
" SHOW_CONTEXT\n"
440 " controls display of message context fields [never, errors, always]\n");
441 HELP0(
" SINGLELINE\n"
442 " if set, end of line terminates SQL commands (same as -S option)\n");
443 HELP0(
" SINGLESTEP\n"
444 " single-step mode (same as -s option)\n");
446 " SQLSTATE of last query, or \"00000\" if no error\n");
448 " the currently connected database user\n");
450 " controls verbosity of error reports [default, verbose, terse, sqlstate]\n");
452 " VERSION_NAME\n"
453 " VERSION_NUM\n"
454 " psql's version (in verbose string, short string, or numeric format)\n");
455
456 HELP0(
"\nDisplay settings:\n");
458 HELP0(
" psql --pset=NAME[=VALUE]\n or \\pset NAME [VALUE] inside psql\n\n");
459
461 " border style (number)\n");
463 " target width for the wrapped format\n");
464 HELP0(
" expanded (or x)\n"
465 " expanded output [on, off, auto]\n");
467 " field separator for unaligned output (default \"%s\")\n",
469 HELP0(
" fieldsep_zero\n"
470 " set field separator for unaligned output to a zero byte\n");
472 " enable or disable display of the table footer [on, off]\n");
474 " set output format [unaligned, aligned, wrapped, html, asciidoc, ...]\n");
476 " set the border line drawing style [ascii, old-ascii, unicode]\n");
478 " set the string to be printed in place of a null value\n");
479 HELP0(
" numericlocale\n"
480 " enable display of a locale-specific character to separate groups of digits\n");
482 " control when an external pager is used [yes, no, always]\n");
484 " record (line) separator for unaligned output\n");
485 HELP0(
" recordsep_zero\n"
486 " set record separator for unaligned output to a zero byte\n");
487 HELP0(
" tableattr (or T)\n"
488 " specify attributes for table tag in html format, or proportional\n"
489 " column widths for left-aligned data types in latex-longtable format\n");
491 " set the table title for subsequently printed tables\n");
492 HELP0(
" tuples_only\n"
493 " if set, only actual table data is shown\n");
494 HELP0(
" unicode_border_linestyle\n"
495 " unicode_column_linestyle\n"
496 " unicode_header_linestyle\n"
497 " set the style of Unicode line drawing [single, double]\n");
498 HELP0(
" xheader_width\n"
499 " set the maximum width of the header for expanded output\n"
500 " [full, column, page, integer value]\n");
501
502 HELP0(
"\nEnvironment variables:\n");
504
505#ifndef WIN32
506 HELP0(
" NAME=VALUE [NAME=VALUE] psql ...\n or \\setenv NAME [VALUE] inside psql\n\n");
507#else
508 HELP0(
" set NAME=VALUE\n psql ...\n or \\setenv NAME [VALUE] inside psql\n\n");
509#endif
510
512 " number of columns for wrapped format\n");
514 " same as the application_name connection parameter\n");
515 HELP0(
" PGDATABASE\n"
516 " same as the dbname connection parameter\n");
518 " same as the host connection parameter\n");
519 HELP0(
" PGPASSFILE\n"
520 " password file name\n");
521 HELP0(
" PGPASSWORD\n"
522 " connection password (not recommended)\n");
524 " same as the port connection parameter\n");
526 " same as the user connection parameter\n");
527 HELP0(
" PSQL_EDITOR, EDITOR, VISUAL\n"
528 " editor used by the \\e, \\ef, and \\ev commands\n");
529 HELP0(
" PSQL_EDITOR_LINENUMBER_ARG\n"
530 " how to specify a line number when invoking the editor\n");
531 HELP0(
" PSQL_HISTORY\n"
532 " alternative location for the command history file\n");
533 HELP0(
" PSQL_PAGER, PAGER\n"
534 " name of external pager program\n");
535#ifndef WIN32
536 HELP0(
" PSQL_WATCH_PAGER\n"
537 " name of external pager program used for \\watch\n");
538#endif
540 " alternative location for the user's .psqlrc file\n");
542 " shell used by the \\! command\n");
544 " directory for temporary files\n");
545
546
547 nlcount = 0;
548 for (
const char *ptr =
buf.data; *ptr; ptr++)
549 {
550 if (*ptr == '\n')
551 nlcount++;
552 }
553
554
556
558
560
562}
#define DEFAULT_FIELD_SEP