diff options
author | Tom Lane | 2001-10-03 18:32:42 +0000 |
---|---|---|
committer | Tom Lane | 2001-10-03 18:32:42 +0000 |
commit | 5c35b5973b19e57f2b4fa8db1dd7b1547ad61ee3 (patch) | |
tree | 8917940b6889dca792507e65c0e4e1b0fc32d3ff | |
parent | 2684f15e4608f63034555cadc6e37125dfc1febf (diff) |
Teach format_type about time/timestamp precision, so that pg_dump and
psql's \d option work properly.
-rw-r--r-- | src/backend/utils/adt/format_type.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/backend/utils/adt/format_type.c b/src/backend/utils/adt/format_type.c index c80b5c429b6..0e189d72461 100644 --- a/src/backend/utils/adt/format_type.c +++ b/src/backend/utils/adt/format_type.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * 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,16 +200,36 @@ format_type_internal(Oid type_oid, int32 typemod, bool allow_invalid) buf = pstrdup("numeric"); 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: - buf = pstrdup("time with time zone"); + if (with_typemod && typemod > 0) + buf = psnprintf(50, "time(%d) with time zone", + typemod); + else + buf = pstrdup("time with time zone"); break; case TIMESTAMPOID: - buf = pstrdup("timestamp without time zone"); + if (with_typemod && typemod > 0) + buf = psnprintf(50, "timestamp(%d) without time zone", + typemod); + else + buf = pstrdup("timestamp without time zone"); break; case TIMESTAMPTZOID: - buf = pstrdup("timestamp with time zone"); + if (with_typemod && typemod > 0) + buf = psnprintf(50, "timestamp(%d) with time zone", + typemod); + else + buf = pstrdup("timestamp with time zone"); break; case VARBITOID: |