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_node.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/backend/parser/parse_node.c') diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index 921da9a04a5..20999f81ffe 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.88 2005/04/23 18:35:12 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.89 2005/05/30 01:20:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -271,8 +271,8 @@ transformArraySubscripts(ParseState *pstate, * have to guess what type is wanted. * * For string literals we produce a constant of type UNKNOWN ---- whose - * representation is the same as text, but it indicates to later type - * resolution that we're not sure that it should be considered text. + * representation is the same as cstring, but it indicates to later type + * resolution that we're not sure yet what type it should be considered. * Explicit "NULL" constants are also typed as UNKNOWN. * * For integers and floats we produce int4, int8, or numeric depending @@ -341,11 +341,14 @@ make_const(Value *value) break; case T_String: - val = DirectFunctionCall1(unknownin, - CStringGetDatum(strVal(value))); + /* + * We assume here that UNKNOWN's internal representation is the + * same as CSTRING + */ + val = CStringGetDatum(strVal(value)); typeid = UNKNOWNOID; /* will be coerced later */ - typelen = -1; /* variable len */ + typelen = -2; /* cstring-style varwidth type */ typebyval = false; break; @@ -362,7 +365,7 @@ make_const(Value *value) case T_Null: /* return a null const */ con = makeConst(UNKNOWNOID, - -1, + -2, (Datum) 0, true, false); -- cgit v1.2.3