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