summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_node.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-30 01:20:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-30 01:20:50 +0000
commitcfd9be939e9c516243c5b6a49ad1e1a9a38f1052 (patch)
tree1f84d32f5d20ada75f911ee700361037ed461140 /src/backend/parser/parse_node.c
parentc8f81df41b1269714c08a508ccecc0adc8ef96bd (diff)
downloadpostgresql-cfd9be939e9c516243c5b6a49ad1e1a9a38f1052.tar.gz
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_node.c')
-rw-r--r--src/backend/parser/parse_node.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 921da9a04a..20999f81ff 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);