sqlreduce
sqlreduce copied to clipboard
SET is_cycle TO TRUE DEFAULT FALSE
sqlreduce shouldn't be this verbose in the CYCLE clause:
$ sqlreduce -d postgres
WITH RECURSIVE
run(x, y) AS (
SELECT 0, 0
UNION ALL
SELECT x, y FROM run AS r WHERE r.is_cycle
)
CYCLE x, y SET is_cycle USING path
TABLE run
Minimal query yielding the same error:
WITH RECURSIVE run(x, y) AS (SELECT NULL, NULL UNION ALL SELECT FROM run AS r WHERE r.is_cycle) CYCLE x, y SET is_cycle TO TRUE DEFAULT FALSE USING path SELECT
From https://www.postgresql.org/message-id/17723-2c4985ff111e7bba%40postgresql.org by @xocolatl.
Oh and of course these might be expressions and could be descended into.