Re: BUG #13870: couldn't restore dump with mat view - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13870: couldn't restore dump with mat view
Date
Msg-id CAB7nPqQVcxrskoO+dWeyupYs2z8u6RiWvw+GfoauubiWh6Mhbg@mail.gmail.com
Whole thread Raw
In response to BUG #13870: couldn't restore dump with mat view  (kardash.a.v@yandex.ru)
List pgsql-bugs
On Sat, Jan 16, 2016 at 2:55 AM,  <kardash.a.v@yandex.ru> wrote:
> Try to feed sql-commands below, then do dump and you will see errors while
> restore!

Here is a shorter sequence of commands to reproduce the failure:
CREATE TABLE stend (line integer);
CREATE FUNCTION point(line integer) RETURNS numeric
     LANGUAGE sql
     AS $$
 WITH t(line) AS (
 SELECT line
 FROM stend
 ) SELECT (4 * line)::numeric FROM t $$;

pg_dump is usually quite smart at detecting dependencies and dumping
objects in the right order, but even if in this case pg_dump is
obviously wrong, there is no way for it to know that the function it
creates depends on this relation.
--
Michael

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13870: couldn't restore dump with mat view
Next
From: Michael Paquier
Date:
Subject: Re: BUG #13870: couldn't restore dump with mat view