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

Enhanced cycle mark values

Per SQL:202x draft, in the CYCLE clause of a recursive query, the
cycle mark values can be of type boolean and can be omitted, in which
case they default to TRUE and FALSE.

Reviewed-by: Vik Fearing <vik@postgresfriends.org>
Discussion: https://www.postgresql.org/message-id/flat/db80ceee-6f97-9b4a-8ee8-3ba0c58e5be2@2ndquadrant.com
This commit is contained in:
Peter Eisentraut
2021-02-27 08:11:14 +01:00
parent 4e90052c46
commit f4adc41c4f
7 changed files with 144 additions and 47 deletions

View File

@@ -11442,6 +11442,17 @@ opt_cycle_clause:
n->location = @1;
$$ = (Node *) n;
}
| CYCLE columnList SET ColId USING ColId
{
CTECycleClause *n = makeNode(CTECycleClause);
n->cycle_col_list = $2;
n->cycle_mark_column = $4;
n->cycle_mark_value = makeBoolAConst(true, -1);
n->cycle_mark_default = makeBoolAConst(false, -1);
n->cycle_path_column = $6;
n->location = @1;
$$ = (Node *) n;
}
| /*EMPTY*/
{
$$ = NULL;