Re: Change in "policy" on dump ordering?
Michael Banck <michael.banck@credativ.de>
From: Michael Banck <michael.banck@credativ.de>
To: Jim Nasby <Jim.Nasby@BlueTreble.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Pg Hackers
<pgsql-hackers@postgresql.org>, Kevin Grittner <kgrittn@gmail.com>
Date: 2017-02-27T14:09:29Z
Lists: pgsql-hackers
Hi, I've found the (AIUI) previous discussion about this, it's Bug #13907: https://www.postgresql.org/message-id/flat/20160202161407.2778.24659%40wrigleys.postgresql.org#20160202161407.2778.24659@wrigleys.postgresql.org On Wed, Feb 22, 2017 at 05:24:49PM -0600, Jim Nasby wrote: > On 2/22/17 12:29 PM, Peter Eisentraut wrote: > >On 2/22/17 10:14, Jim Nasby wrote: > >>CREATE MATERIALIZED VIEW tmv AS SELECT * FROM pg_subscription; > >>SELECT 0 > >> > >>IOW, you can create matviews that depend on any other > >>table/view/matview, but right now if the matview includes certain items > >>it will mysteriously end up empty post-restore. > > > >Yes, by that logic matview refresh should always be last. In https://www.postgresql.org/message-id/9af4bc32-7e55-a21d-47e7-608582a8c48d%402ndquadrant.com you (Peter) wrote: "The reason that ACLs are restored last is that they could contain owner self-revokes. So anything that you run after the ACLs could fail because of that. I think a more complete fix would be to split up the ACL restores into the general part, which you would run right after the object is restored, and the owner revokes, which you would run last." > Patches for head attached. FWIW, Keven Grittner had proposed a more involved patch in https://www.postgresql.org/message-id/CACjxUsNmpQDL58zRm3EFS9atqGT8%2BX_2%2BFOCXpYBwWZw5wgi-A%40mail.gmail.com Michael -- Michael Banck Projektleiter / Senior Berater Tel.: +49 2166 9901-171 Fax: +49 2166 9901-100 Email: michael.banck@credativ.de credativ GmbH, HRB Mönchengladbach 12080 USt-ID-Nummer: DE204566209 Trompeterallee 108, 41189 Mönchengladbach Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
Commits
-
Fix pg_dump/pg_restore to emit REFRESH MATERIALIZED VIEW commands last.
- b93217653b68 9.4.13 landed
- 65048cf23dba 9.5.8 landed
- 3d76328298ca 9.6.4 landed
- 3eb9a5e7c4c9 10.0 landed
- 035bb82222bc 9.3.18 landed