aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_node.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-10-31 10:22:13 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-10-31 10:22:13 +0000
commit73874a06f02691b32c07318e543d83e7947efa51 (patch)
treec401c757c898211a54701e728b120dd7178e77d5 /src/backend/parser/parse_node.c
parentd397c1c8a2dfec4ac93eb0e1b3f96418bb98fdd7 (diff)
downloadpostgresql-73874a06f02691b32c07318e543d83e7947efa51.tar.gz
postgresql-73874a06f02691b32c07318e543d83e7947efa51.zip
Change the parser to convert SQL "position" and "substring" syntax to
position() and substring() functions, so that it works transparently for bit types as well. Alias the text functions appropriately. Add position() for bit types. Add new constant node T_BitString that represents literals of the form B'1001 and pass those to zpbit type.
Diffstat (limited to 'src/backend/parser/parse_node.c')
-rw-r--r--src/backend/parser/parse_node.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 2ff4d9c990b..d23c5c1e7c7 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.47 2000/09/29 18:21:36 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.48 2000/10/31 10:22:11 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,6 +31,7 @@
#include "parser/parse_target.h"
#include "parser/parse_type.h"
#include "utils/builtins.h"
+#include "utils/varbit.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
@@ -473,6 +474,16 @@ make_const(Value *value)
typebyval = false;
break;
+ case T_BitString:
+ val = DirectFunctionCall3(zpbit_in,
+ CStringGetDatum(strVal(value)),
+ ObjectIdGetDatum(InvalidOid),
+ Int32GetDatum(-1));
+ typeid = ZPBITOID;
+ typelen = -1;
+ typebyval = false;
+ break;
+
default:
elog(NOTICE, "make_const: unknown type %d", nodeTag(value));
/* FALLTHROUGH */