Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cggUr-0007dC-Ex for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Feb 2017 23:38:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cggUq-00068D-TW for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Feb 2017 23:38:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cggUp-00064j-DI for pgsql-hackers@postgresql.org; Wed, 22 Feb 2017 23:38:55 +0000 Received: from mout.gmx.net ([212.227.17.22]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cggUm-00010b-C8 for pgsql-hackers@postgresql.org; Wed, 22 Feb 2017 23:38:54 +0000 Received: from nighthawk.chemicalconnection.dyndns.org ([88.217.114.135]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Meutp-1d0qsb2nZh-00OUqE; Thu, 23 Feb 2017 00:38:40 +0100 Received: from mbanck by nighthawk.chemicalconnection.dyndns.org with local (Exim 4.84_2) (envelope-from ) id 1cggUL-0008P9-KZ; Thu, 23 Feb 2017 00:38:25 +0100 Date: Thu, 23 Feb 2017 00:38:25 +0100 From: Michael Banck To: Jim Nasby Cc: Peter Eisentraut , Pg Hackers Subject: Re: Change in "policy" on dump ordering? Message-ID: <20170222233825.GC7222@nighthawk.caipicrew.dd-dns.de> References: <87866740-ef55-8a6d-6480-499b92aa23c0@BlueTreble.com> <8f64786e-824d-7c0d-33a6-3d9e1c8e9fde@2ndquadrant.com> <33b25c65-94f1-6ff6-c717-61a56294a255@2ndquadrant.com> <75409fb1-bd96-25c2-f6b0-c24e28ed2684@2ndquadrant.com> <65049c27-96bf-317b-b435-931f6041f94c@BlueTreble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <65049c27-96bf-317b-b435-931f6041f94c@BlueTreble.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:iVSkl7piv1PIR4sUKsxDaKQDCXyqODQPZxkRb3UKhuhA8ez4DNf ZNW+U4ahoCyadVdTblA7eG1Z7orDk2LqJf06LMqT35DBX2boR3QzRE9jgiP/qa3FkuCQuck Cchi/VjaVnTroXaOAU+P5uuWcB+7/BixBfIFFETZX6CJM2QOgFuO4CCBACNv5uyknB2J7tJ gGmuP3qohWynOpX5IdYpw== X-UI-Out-Filterresults: notjunk:1;V01:K0:HoUZHFNsOks=:piSoWUJHjKbPb8pMnRBZej OXh4GctLew/cqZqQVEYO7R1jg+TJ6QiR0kSjRPqY5cSVufF+HZIV6dt9fRVs/6jraTU1iHL+K tFOjkFTqyQBsjuWab/psu9OeAhnIITSJveKXXZbm18/KgSsaBD2SChPc0tU0DLhN/DIYFyZ/B oxJdaoQEPls+oVKuVeciA/3D29JBDdeuEeRjIhQ37vinRD5Gp7Ow3cJAugohCuSx3SBoKBSJ6 PdiFM6m4A9Mpljz03QxwJrMdi8AEyRUjpGBkXlH7oNhtI00KKs3hhnXkl4J2ZsqzEIrsnn+LS E1jdYLxNc/Ei0PE2gXqgAknhbIXma5q7KaL1nkJWvmhNikU7tkyNfwdTj1IEcyzecVj6cQWBJ n0/2AAnt+mJ48i4DWhg+C/datTNzbR8KQM+bqNaVSseQOb+f8M3bjqoLehkCqemZTL4E/nqQ6 P7vmjRbgTEbSH2ebCikOd7EhF54zb661jKB0RDv54hxOr0e7mWFsI/wPzEnIbdRwcDOqbVcFj y+Dp+QCJ+7J2zS3UQFjfff2oUxDuxQskB/NXH22tqYPGM7F8RyPiI0VW7grKyQs6o1xaRrsB3 gj4xsZIsh/rcK0CS7j5metLRAiv5nKU0OVuh/rS/5/Yvkxq7a3olkaijtKaXWmttCLPaWtV9B 11ClI+MmGlBnA51MTk5Hlc4Eje+8Cwkme4KUx8hlZUYd5OUHTI0KntEkctEl9R1TZbQE6PM6k lF5QV+SsIVCcrm1vNVUTaXrko9fCOp6lBdz4iD3STyvJKtIZdQsYXzYNE06Izhg2ZqY540rVj 8iCpoidQBXTF/53XoNiUyl0dPZzavemFq5M6ops2IVTsJGK79W4Hc/f3ovrkMt0HSLmuekUL+ iVKRPveimZ+L/8KWbwMPkB4x3QOIa8Os+kiumdNJKCi3COS5sQGklA8cK2czaZbBPF9JDeQ2f Lq7QzzNEDU75DdpiYHtEwcntx38C4ehLzenRGamMmENNvwooSHoURdgRGv3Ike8ItDJFMt8S0 u+H5g75SOEKDZ5/PMGQFcKI9Y3LqgsiYMox8dWGDMuR/ X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, 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. Glad to hear - I vaguely remember this coming up in a different thread some time ago, and I though you (Peter) had reservations about moving things past after the ACL step, but I couldn't find this thread now anymore, only https://www.postgresql.org/message-id/11166.1424357659%40sss.pgh.pa.us > Patches for head attached. Yay. > diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c > index ea643397ba..708a47f3cb 100644 > --- a/src/bin/pg_dump/pg_dump_sort.c > +++ b/src/bin/pg_dump/pg_dump_sort.c > @@ -26,6 +26,9 @@ static const char *modulename = gettext_noop("sorter"); > * Sort priority for database object types. > * Objects are sorted by type, and within a type by name. > * > + * Because materialized views can potentially reference system views, > + * DO_REFRESH_MATVIEW should always be the last thing on the list. > + * I think this comment is overly specific: any materialized view that references a view or table in a different schema (pg_catalog or not) will likely not refresh on pg_restore AIUI, so singling out system views doesn't look right to me. 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers