Disable expanded mode only for \d tablename, not for all backslash

commands.  Per complaint that \df+ is clearer in expanded mode.
This commit is contained in:
Bruce Momjian 2005-10-27 13:34:47 +00:00
parent 69f16b562a
commit 3332e38189
6 changed files with 11 additions and 13 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.394 2005/10/26 19:21:53 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.395 2005/10/27 13:34:46 momjian Exp $
Typical markup:
@ -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>

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.108 2005/10/15 02:49:40 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.109 2005/10/27 13:34:47 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@ -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)
{

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.128 2005/10/20 05:15:09 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.129 2005/10/27 13:34:47 momjian Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
@ -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);

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.78 2005/10/15 02:49:40 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.79 2005/10/27 13:34:47 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@ -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;

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.29 2005/10/15 02:49:40 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.30 2005/10/27 13:34:47 momjian Exp $
*/
#ifndef PRINT_H
#define PRINT_H
@ -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;

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.125 2005/10/15 02:49:40 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.126 2005/10/27 13:34:47 momjian Exp $
*/
#include "postgres_fe.h"
@ -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);