From cfd9be939e9c516243c5b6a49ad1e1a9a38f1052 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 30 May 2005 01:20:50 +0000 Subject: Change the UNKNOWN type to have an internal representation matching cstring, rather than text, so as to eliminate useless conversions inside the parser. Per recent discussion. --- src/backend/parser/parse_coerce.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/backend/parser/parse_coerce.c') diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c index 094e99a8acf..e46b63f6d9f 100644 --- a/src/backend/parser/parse_coerce.c +++ b/src/backend/parser/parse_coerce.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.129 2005/05/29 18:24:13 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.130 2005/05/30 01:20:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -168,8 +168,11 @@ coerce_type(ParseState *pstate, Node *node, if (!con->constisnull) { - char *val = DatumGetCString(DirectFunctionCall1(unknownout, - con->constvalue)); + /* + * We assume here that UNKNOWN's internal representation is the + * same as CSTRING + */ + char *val = DatumGetCString(con->constvalue); /* * We pass typmod -1 to the input routine, primarily because @@ -183,7 +186,6 @@ coerce_type(ParseState *pstate, Node *node, * ugly... */ newcon->constvalue = stringTypeDatum(targetType, val, -1); - pfree(val); } result = (Node *) newcon; -- cgit v1.2.3