mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user