diff options
Diffstat (limited to 'src/backend/nodes/print.c')
-rw-r--r-- | src/backend/nodes/print.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c index 4934c09e2b3..035bb7aa65e 100644 --- a/src/backend/nodes/print.c +++ b/src/backend/nodes/print.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.68 2004/05/30 23:40:27 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.69 2004/06/06 00:41:26 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -20,7 +20,6 @@ #include "postgres.h" #include "access/printtup.h" -#include "catalog/pg_type.h" #include "lib/stringinfo.h" #include "nodes/print.h" #include "optimizer/clauses.h" @@ -345,9 +344,9 @@ print_expr(Node *expr, List *rtable) else if (IsA(expr, Const)) { Const *c = (Const *) expr; - HeapTuple typeTup; Oid typoutput; - Oid typelem; + Oid typioparam; + bool typIsVarlena; char *outputstr; if (c->constisnull) @@ -356,18 +355,12 @@ print_expr(Node *expr, List *rtable) return; } - typeTup = SearchSysCache(TYPEOID, - ObjectIdGetDatum(c->consttype), - 0, 0, 0); - if (!HeapTupleIsValid(typeTup)) - elog(ERROR, "cache lookup failed for type %u", c->consttype); - typoutput = ((Form_pg_type) GETSTRUCT(typeTup))->typoutput; - typelem = ((Form_pg_type) GETSTRUCT(typeTup))->typelem; - ReleaseSysCache(typeTup); + getTypeOutputInfo(c->consttype, + &typoutput, &typioparam, &typIsVarlena); outputstr = DatumGetCString(OidFunctionCall3(typoutput, c->constvalue, - ObjectIdGetDatum(typelem), + ObjectIdGetDatum(typioparam), Int32GetDatum(-1))); printf("%s", outputstr); pfree(outputstr); |