Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteabd1b2

Browse files
committed
Have psql output tab as the proper number of spaces, rather than \x09.
1 parent5adf98a commiteabd1b2

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

‎src/bin/psql/mbprint.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.31 2008/05/0817:04:26 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.32 2008/05/0819:11:36 momjian Exp $
77
*
88
* XXX this file does not really belong in psql/. Perhaps move to libpq?
99
* It also seems that the mbvalidate function is redundant with existing
@@ -321,6 +321,14 @@ pg_wcsformat(unsigned char *pwcs, size_t len, int encoding,
321321
linewidth+=2;
322322
ptr+=2;
323323
}
324+
elseif (*pwcs=='\t')/* Tab */
325+
{
326+
do
327+
{
328+
*ptr++=' ';
329+
linewidth++;
330+
}while (linewidth %8!=0);
331+
}
324332
elseif (w<0)/* Other control char */
325333
{
326334
sprintf((char*)ptr,"\\x%02X",*pwcs);

‎src/test/regress/expected/prepare.out

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,17 @@ SELECT name, statement, parameter_types FROM pg_prepared_statements
155155
name | statement | parameter_types
156156
------+-----------------------------------------------------------------+--------------------------------------------------------
157157
q2 | PREPARE q2(text) AS | {text}
158-
:\x09SELECTdatname, datistemplate, datallowconn
159-
:\x09FROMpg_database WHERE datname = $1;
158+
: SELECTdatname, datistemplate, datallowconn
159+
: FROMpg_database WHERE datname = $1;
160160
q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS | {text,integer,"double precision",boolean,oid,smallint}
161-
: \x09SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
162-
: \x09ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int)
163-
: \x09ORDER BY unique1;
161+
: SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 O
162+
; R
163+
: ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::
164+
; int)
165+
: ORDER BY unique1;
164166
q5 | PREPARE q5(int, text) AS | {integer,text}
165-
:\x09SELECT* FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2
166-
:\x09ORDERBY unique1;
167+
: SELECT* FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2
168+
: ORDERBY unique1;
167169
q6 | PREPARE q6 AS | {integer,name}
168170
: SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2;
169171
q7 | PREPARE q7(unknown) AS | {path}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp