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