Index: doc/src/sgml/ref/psql-ref.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v retrieving revision 1.203 diff -c -c -r1.203 psql-ref.sgml *** doc/src/sgml/ref/psql-ref.sgml 8 May 2008 17:04:26 -0000 1.203 --- doc/src/sgml/ref/psql-ref.sgml 13 May 2008 20:52:29 -0000 *************** *** 673,685 **** ! \a ! If the current table output format is unaligned, it is switched to aligned. ! If it is not unaligned, it is set to unaligned. This command is ! kept for backwards compatibility. See \pset for a ! more general solution. --- 673,687 ---- ! \a [ ON | ! OFF ] ! Without parameter, toggle format between aligned and ! unaligned. With parameter, set it. This command is kept for ! backwards compatibility. See \pset for a more ! general solution. *************** *** 1292,1305 **** ! \H ! Turns on HTML query output format. If the ! HTML format is already on, it is switched ! back to the default aligned text format. This command is for ! compatibility and convenience, but see \pset ! about setting other output options. --- 1294,1308 ---- ! \H [ ON | ! OFF ] ! Without parameter, toggles between HTML and ! aligned query output format. With paramter, sets it. ! This command is for compatibility and convenience, but see ! \pset about setting other output options. *************** *** 1867,1876 **** ! \timing ! Toggles a display of how long each SQL statement takes, in milliseconds. --- 1870,1882 ---- ! \timing [ON | OFF] ! Without parameter, toggles a display of how long each SQL ! statement takes, in milliseconds. With parameter, sets same. Index: src/bin/psql/command.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/bin/psql/command.c,v retrieving revision 1.188 diff -c -c -r1.188 command.c *** src/bin/psql/command.c 8 May 2008 17:04:26 -0000 1.188 --- src/bin/psql/command.c 13 May 2008 20:52:29 -0000 *************** *** 180,189 **** */ if (strcmp(cmd, "a") == 0) { ! if (pset.popt.topt.format != PRINT_ALIGNED) ! success = do_pset("format", "aligned", &pset.popt, pset.quiet); else ! success = do_pset("format", "unaligned", &pset.popt, pset.quiet); } /* \C -- override table title (formerly change HTML caption) */ --- 180,199 ---- */ if (strcmp(cmd, "a") == 0) { ! char *opt = psql_scan_slash_option(scan_state, ! OT_NORMAL, NULL, true); ! if (opt) ! success = do_pset("format", ! ParseVariableBool(opt) ? "aligned" : "unaligned", ! &pset.popt, pset.quiet); else ! { ! if (pset.popt.topt.format != PRINT_ALIGNED) ! success = do_pset("format", "aligned", &pset.popt, pset.quiet); ! else ! success = do_pset("format", "unaligned", &pset.popt, pset.quiet); ! } ! free(opt); } /* \C -- override table title (formerly change HTML caption) */ *************** *** 538,547 **** /* HTML mode */ else if (strcmp(cmd, "H") == 0 || strcmp(cmd, "html") == 0) { ! if (pset.popt.topt.format != PRINT_HTML) ! success = do_pset("format", "html", &pset.popt, pset.quiet); else ! success = do_pset("format", "aligned", &pset.popt, pset.quiet); } --- 548,567 ---- /* HTML mode */ else if (strcmp(cmd, "H") == 0 || strcmp(cmd, "html") == 0) { ! char *opt = psql_scan_slash_option(scan_state, ! OT_NORMAL, NULL, false); ! if (opt) ! success = do_pset("format", ! ParseVariableBool(opt) ? "html" : "aligned", ! &pset.popt, pset.quiet); else ! { ! if (pset.popt.topt.format != PRINT_HTML) ! success = do_pset("format", "html", &pset.popt, pset.quiet); ! else ! success = do_pset("format", "aligned", &pset.popt, pset.quiet); ! } ! free(opt); } *************** *** 884,890 **** /* \timing -- toggle timing of queries */ else if (strcmp(cmd, "timing") == 0) { ! pset.timing = !pset.timing; if (!pset.quiet) { if (pset.timing) --- 904,915 ---- /* \timing -- toggle timing of queries */ else if (strcmp(cmd, "timing") == 0) { ! char *opt = psql_scan_slash_option(scan_state, ! OT_NORMAL, NULL, false); ! if (opt) ! pset.timing = ParseVariableBool(opt); ! else ! pset.timing = !pset.timing; if (!pset.quiet) { if (pset.timing) *************** *** 892,897 **** --- 917,923 ---- else puts(_("Timing is off.")); } + free(opt); } /* \unset */