sqlreduce icon indicating copy to clipboard operation
sqlreduce copied to clipboard

SET is_cycle TO TRUE DEFAULT FALSE

Open df7cb opened this issue 3 years ago • 1 comments

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.

df7cb avatar Dec 16 '22 15:12 df7cb

Oh and of course these might be expressions and could be descended into.

df7cb avatar Dec 16 '22 15:12 df7cb