dumping recursive views broken in master

Started by Peter Eisentrautover 13 years ago2 messages
#1Peter Eisentraut
peter_e@gmx.net

CREATE VIEW sums_1_100 AS
WITH RECURSIVE t(n) AS (
VALUES (1)
UNION ALL
SELECT n+1 FROM t WHERE n < 100
)
SELECT sum(n) FROM t;

dumps as

CREATE VIEW sums_1_100 AS
WITH RECURSIVE t(n) AS (VALUES (1) UNION ALL SELECT (t_1.n + 1) FROM
t WHERE (t_1.n < 100)) SELECT sum(t.n) AS sum FROM t;

which doesn't load back, because of this missing FROM item "t_1".

Evidently, this is related to

commit 11e131854f8231a21613f834c40fe9d046926387
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri Sep 21 19:03:10 2012 -0400

Improve ruleutils.c's heuristics for dealing with rangetable aliases.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: dumping recursive views broken in master

Peter Eisentraut <peter_e@gmx.net> writes:

CREATE VIEW sums_1_100 AS
WITH RECURSIVE t(n) AS (
VALUES (1)
UNION ALL
SELECT n+1 FROM t WHERE n < 100
)
SELECT sum(n) FROM t;

dumps as

CREATE VIEW sums_1_100 AS
WITH RECURSIVE t(n) AS (VALUES (1) UNION ALL SELECT (t_1.n + 1) FROM
t WHERE (t_1.n < 100)) SELECT sum(t.n) AS sum FROM t;

which doesn't load back, because of this missing FROM item "t_1".

Evidently, this is related to

commit 11e131854f8231a21613f834c40fe9d046926387
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri Sep 21 19:03:10 2012 -0400

Improve ruleutils.c's heuristics for dealing with rangetable aliases.

Oops. I'll take a look.

regards, tom lane