Disable expanded mode only for \d tablename, not for all backslash
authorBruce Momjian <bruce@momjian.us>
Thu, 27 Oct 2005 13:34:47 +0000 (13:34 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 27 Oct 2005 13:34:47 +0000 (13:34 +0000)
commands.  Per complaint that \df+ is clearer in expanded mode.

doc/src/sgml/release.sgml
src/bin/psql/common.c
src/bin/psql/describe.c
src/bin/psql/print.c
src/bin/psql/print.h
src/bin/psql/startup.c

index 27c8e9c99ba924f86ae25c2f9b69dde5e5c2e9d3..edf8e026d69b864461f13ef75870d2dbd603b0b2 100644 (file)
@@ -1700,7 +1700,7 @@ psql -t -f fixseq.sql db1 | psql -e db1
       <listitem>
        <para>
         Prevent <command>\x</> (expanded mode) from affecting
-        backslash-command displays (Neil)
+        the output of <command>\d tablename<\> (Neil)
        </para>
       </listitem>
 
index 8c068c40f59c3eaed3b3ac90c8cff69c46dd2227..374e69c4937b09bd3056699f011b96c2acf2d83d 100644 (file)
@@ -795,8 +795,6 @@ PrintQueryTuples(const PGresult *results)
 {
        printQueryOpt my_popt = pset.popt;
 
-       my_popt.topt.normal_query = true;
-
        /* write output to \g argument, if any */
        if (pset.gfname)
        {
index 96ab5e50e4e47d4dee4e94423d8b87b33d99a6bf..31b6321fc051533900c9431245fa646d002507db 100644 (file)
@@ -703,6 +703,9 @@ describeOneTableDetails(const char *schemaname,
 
        retval = false;
 
+       /* This output looks confusing in expanded mode. */
+       myopt.expanded = false;
+
        initPQExpBuffer(&buf);
        initPQExpBuffer(&title);
        initPQExpBuffer(&tmpbuf);
index f7c8ac65e17ea6670c93898d704052671d3a8ecc..fadc30b87393f83e1c23517c451b83ce933027ab 100644 (file)
@@ -1491,7 +1491,7 @@ printTable(const char *title,
         * normal (user-submitted) query, not a table we're printing for a slash
         * command.
         */
-       if (opt->expanded && opt->normal_query)
+       if (opt->expanded)
                use_expanded = true;
        else
                use_expanded = false;
index dc572bac73ad22511c1b397b844127c8b6be9b98..645587e21bd4ca9c721e3708327aef9a41bf808b 100644 (file)
@@ -43,8 +43,6 @@ typedef struct _printTableOpt
                                                                 * decimal marker */
        char       *tableAttr;          /* attributes for HTML <table ...> */
        int                     encoding;               /* character encoding */
-       bool            normal_query;   /* are we presenting the results of a "normal"
-                                                                * query, or a slash command? */
 } printTableOpt;
 
 
index 0ec2f72f9c777037d8257fb90ac77414749055f8..90b0c53cb4053c3e0d6478a53708c5ffc1340e0f 100644 (file)
@@ -147,7 +147,6 @@ main(int argc, char *argv[])
        pset.queryFout = stdout;
        pset.popt.topt.border = 1;
        pset.popt.topt.pager = 1;
-       pset.popt.topt.normal_query = false;
        pset.popt.default_footer = true;
 
        SetVariable(pset.vars, "VERSION", PG_VERSION_STR);