summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2008-05-08 19:11:36 +0000
committerBruce Momjian2008-05-08 19:11:36 +0000
commit3a18c7fb2bdbd7a2a58e074503cf77ccca55f5ef (patch)
treef9194f78f244d31eaaba6118949f4ae14cefdc44
parentf92f424d600b94c01423d05ac586d978a4688fcb (diff)
Have psql output tab as the proper number of spaces, rather than \x09.
-rw-r--r--src/bin/psql/mbprint.c8
-rw-r--r--src/test/regress/expected/prepare.out16
2 files changed, 17 insertions, 7 deletions
diff --git a/src/bin/psql/mbprint.c b/src/bin/psql/mbprint.c
index 2d70d132eb..d274b4a774 100644
--- a/src/bin/psql/mbprint.c
+++ b/src/bin/psql/mbprint.c
@@ -321,6 +321,14 @@ pg_wcsformat(unsigned char *pwcs, size_t len, int encoding,
linewidth += 2;
ptr += 2;
}
+ else if (*pwcs == '\t') /* Tab */
+ {
+ do
+ {
+ *ptr++ = ' ';
+ linewidth++;
+ } while (linewidth % 8 != 0);
+ }
else if (w < 0) /* Other control char */
{
sprintf((char *) ptr, "\\x%02X", *pwcs);
diff --git a/src/test/regress/expected/prepare.out b/src/test/regress/expected/prepare.out
index 35e1befcbb..dec093f1a2 100644
--- a/src/test/regress/expected/prepare.out
+++ b/src/test/regress/expected/prepare.out
@@ -155,15 +155,17 @@ SELECT name, statement, parameter_types FROM pg_prepared_statements
name | statement | parameter_types
------+-----------------------------------------------------------------+--------------------------------------------------------
q2 | PREPARE q2(text) AS | {text}
- : \x09SELECT datname, datistemplate, datallowconn
- : \x09FROM pg_database WHERE datname = $1;
+ : SELECT datname, datistemplate, datallowconn
+ : FROM pg_database WHERE datname = $1;
q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS | {text,integer,"double precision",boolean,oid,smallint}
- : \x09SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
- : \x09ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int)
- : \x09ORDER BY unique1;
+ : SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 O
+ ; R
+ : ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::
+ ; int)
+ : ORDER BY unique1;
q5 | PREPARE q5(int, text) AS | {integer,text}
- : \x09SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2
- : \x09ORDER BY unique1;
+ : SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2
+ : ORDER BY unique1;
q6 | PREPARE q6 AS | {integer,name}
: SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2;
q7 | PREPARE q7(unknown) AS | {path}