diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-30 01:20:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-30 01:20:50 +0000 |
commit | cfd9be939e9c516243c5b6a49ad1e1a9a38f1052 (patch) | |
tree | 1f84d32f5d20ada75f911ee700361037ed461140 /src/backend/parser/parse_coerce.c | |
parent | c8f81df41b1269714c08a508ccecc0adc8ef96bd (diff) | |
download | postgresql-cfd9be939e9c516243c5b6a49ad1e1a9a38f1052.tar.gz postgresql-cfd9be939e9c516243c5b6a49ad1e1a9a38f1052.zip |
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.
Diffstat (limited to 'src/backend/parser/parse_coerce.c')
-rw-r--r-- | src/backend/parser/parse_coerce.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; |