diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-01-14 10:46:49 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-01-17 10:38:23 +0100 |
commit | 941460fcf731a32e6a90691508d5cfa3d1f8eeaf (patch) | |
tree | 2de0be4abcf7db131607ce9ba590a8040c16d6e3 /src/backend/commands/sequence.c | |
parent | ca86a63d207aca1f52ff13a1ce13854681d1bbf9 (diff) | |
download | postgresql-941460fcf731a32e6a90691508d5cfa3d1f8eeaf.tar.gz postgresql-941460fcf731a32e6a90691508d5cfa3d1f8eeaf.zip |
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
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r-- | src/backend/commands/sequence.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index f2ffd42a05f..27cb6307581 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -1401,7 +1401,7 @@ init_params(ParseState *pstate, List *options, bool for_identity, /* CYCLE */ if (is_cycled != NULL) { - seqform->seqcycle = intVal(is_cycled->arg); + seqform->seqcycle = boolVal(is_cycled->arg); Assert(BoolIsValid(seqform->seqcycle)); seqdataform->log_cnt = 0; } @@ -1739,7 +1739,7 @@ sequence_options(Oid relid) options = lappend(options, makeDefElem("cache", (Node *) makeFloat(psprintf(INT64_FORMAT, pgsform->seqcache)), -1)); options = lappend(options, - makeDefElem("cycle", (Node *) makeInteger(pgsform->seqcycle), -1)); + makeDefElem("cycle", (Node *) makeBoolean(pgsform->seqcycle), -1)); options = lappend(options, makeDefElem("increment", (Node *) makeFloat(psprintf(INT64_FORMAT, pgsform->seqincrement)), -1)); options = lappend(options, |