1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

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 <pavel.stehule@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/8c1a2e37-c68d-703c-5a83-7a6077f4f997@enterprisedb.com
This commit is contained in:
Peter Eisentraut
2022-01-14 10:46:49 +01:00
parent ca86a63d20
commit 941460fcf7
20 changed files with 211 additions and 128 deletions

View File

@@ -3138,6 +3138,14 @@ _equalFloat(const Float *a, const Float *b)
return true;
}
static bool
_equalBoolean(const Boolean *a, const Boolean *b)
{
COMPARE_SCALAR_FIELD(boolval);
return true;
}
static bool
_equalString(const String *a, const String *b)
{
@@ -3374,6 +3382,9 @@ equal(const void *a, const void *b)
case T_Float:
retval = _equalFloat(a, b);
break;
case T_Boolean:
retval = _equalBoolean(a, b);
break;
case T_String:
retval = _equalString(a, b);
break;