Commit 5c35b597 authored by Tom Lane's avatar Tom Lane

Teach format_type about time/timestamp precision, so that pg_dump and

psql's \d option work properly.
parent 2684f15e
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.16 2001/09/28 08:09:10 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.17 2001/10/03 18:32:42 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -200,15 +200,35 @@ format_type_internal(Oid type_oid, int32 typemod, bool allow_invalid) ...@@ -200,15 +200,35 @@ format_type_internal(Oid type_oid, int32 typemod, bool allow_invalid)
buf = pstrdup("numeric"); buf = pstrdup("numeric");
break; break;
case TIMEOID:
if (with_typemod && typemod > 0)
buf = psnprintf(50, "time(%d) without time zone",
typemod);
else
buf = pstrdup("time without time zone");
break;
case TIMETZOID: case TIMETZOID:
if (with_typemod && typemod > 0)
buf = psnprintf(50, "time(%d) with time zone",
typemod);
else
buf = pstrdup("time with time zone"); buf = pstrdup("time with time zone");
break; break;
case TIMESTAMPOID: case TIMESTAMPOID:
if (with_typemod && typemod > 0)
buf = psnprintf(50, "timestamp(%d) without time zone",
typemod);
else
buf = pstrdup("timestamp without time zone"); buf = pstrdup("timestamp without time zone");
break; break;
case TIMESTAMPTZOID: case TIMESTAMPTZOID:
if (with_typemod && typemod > 0)
buf = psnprintf(50, "timestamp(%d) with time zone",
typemod);
else
buf = pstrdup("timestamp with time zone"); buf = pstrdup("timestamp with time zone");
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment