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

Commit5c35b59

Browse files
committed
Teach format_type about time/timestamp precision, so that pg_dump and
psql's \d option work properly.
1 parent2684f15 commit5c35b59

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

‎src/backend/utils/adt/format_type.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.16 2001/09/28 08:09:10 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.17 2001/10/03 18:32:42 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -200,16 +200,36 @@ format_type_internal(Oid type_oid, int32 typemod, bool allow_invalid)
200200
buf=pstrdup("numeric");
201201
break;
202202

203+
caseTIMEOID:
204+
if (with_typemod&&typemod>0)
205+
buf=psnprintf(50,"time(%d) without time zone",
206+
typemod);
207+
else
208+
buf=pstrdup("time without time zone");
209+
break;
210+
203211
caseTIMETZOID:
204-
buf=pstrdup("time with time zone");
212+
if (with_typemod&&typemod>0)
213+
buf=psnprintf(50,"time(%d) with time zone",
214+
typemod);
215+
else
216+
buf=pstrdup("time with time zone");
205217
break;
206218

207219
caseTIMESTAMPOID:
208-
buf=pstrdup("timestamp without time zone");
220+
if (with_typemod&&typemod>0)
221+
buf=psnprintf(50,"timestamp(%d) without time zone",
222+
typemod);
223+
else
224+
buf=pstrdup("timestamp without time zone");
209225
break;
210226

211227
caseTIMESTAMPTZOID:
212-
buf=pstrdup("timestamp with time zone");
228+
if (with_typemod&&typemod>0)
229+
buf=psnprintf(50,"timestamp(%d) with time zone",
230+
typemod);
231+
else
232+
buf=pstrdup("timestamp with time zone");
213233
break;
214234

215235
caseVARBITOID:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp