From 941460fcf731a32e6a90691508d5cfa3d1f8eeaf Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 14 Jan 2022 10:46:49 +0100 Subject: Add Boolean node Before, SQL-level boolean constants were represented by a string with a cast, and internal Boolean values in DDL commands were usually represented by Integer nodes. This takes the place of both of these uses, making the intent clearer and having some amount of type safety. Reviewed-by: Pavel Stehule Discussion: https://www.postgresql.org/message-id/flat/8c1a2e37-c68d-703c-5a83-7a6077f4f997@enterprisedb.com --- src/backend/parser/parse_node.c | 8 ++++++++ 1 file changed, 8 insertions(+) (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 95913c80215..35db6b6c988 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -426,6 +426,14 @@ make_const(ParseState *pstate, A_Const *aconst) } break; + case T_Boolean: + val = BoolGetDatum(boolVal(&aconst->val)); + + typeid = BOOLOID; + typelen = 1; + typebyval = true; + break; + case T_String: /* -- cgit v1.2.3