Re: BUG #13870: couldn't restore dump with mat view

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: kardash(dot)a(dot)v(at)yandex(dot)ru
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13870: couldn't restore dump with mat view
Date: 2016-01-16 05:57:50
Message-ID: CAB7nPqQVcxrskoO+dWeyupYs2z8u6RiWvw+GfoauubiWh6Mhbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Jan 16, 2016 at 2:55 AM, <kardash(dot)a(dot)v(at)yandex(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2016-01-16 06:01:02 Re: BUG #13870: couldn't restore dump with mat view
Previous Message Tom Lane 2016-01-16 01:58:17 Re: BUG #13870: couldn't restore dump with mat view