From: | felix(dot)buenemann(at)gmail(dot)com |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #12766: Dump/Load of Materialized View with inlined SQL function fails |
Date: | 2015-02-13 00:00:55 |
Message-ID: | 20150213000055.2584.16773@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 12766
Logged by: Felix Buenemann
Email address: felix(dot)buenemann(at)gmail(dot)com
PostgreSQL version: 9.4.1
Operating system: Mac OS X 10.10.2
Description:
pg_dump dumps materialized views in the wrong order, if the view is
alphabetically sorted before a table that it references indirectly through a
stored procedure in sql language.
The reason seems to be that pg_dump does not know about the indirect
dependency of the matview, so it doesn't reorder the tables/matviews
properly.
This leads to errors like this on restore:
psql:foo.sql:43: ERROR: relation "foo" does not exist
LINE 1: SELECT label FROM foo WHERE id = value;
^
QUERY: SELECT label FROM foo WHERE id = value;
CONTEXT: SQL function "foo_label" during inlining
Problematic dump from error above:
https://gist.github.com/056f157a200e334dc5b0
Minimal testcase (thanks to RhodiumToad on IRC):
http://pgsql.privatepaste.com/cc80393e25
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-02-13 00:46:46 | Re: BUG #12766: Dump/Load of Materialized View with inlined SQL function fails |
Previous Message | Alvaro Herrera | 2015-02-12 22:51:35 | Re: BUG #12760: Lateral files with more than 2 laterals |