Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmLdb-0006OB-Nl for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Jan 2019 16:44:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gmLdZ-00010N-OQ for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Jan 2019 16:44:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmLdZ-000108-EP for pgsql-bugs@lists.postgresql.org; Wed, 23 Jan 2019 16:44:25 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmLdV-00018e-HW for pgsql-bugs@lists.postgresql.org; Wed, 23 Jan 2019 16:44:23 +0000 Received: by mail-qt1-x843.google.com with SMTP id l12so3077467qtf.8 for ; Wed, 23 Jan 2019 08:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=cHE79bQz76nw7VlW8H/3FDgY4UV216xJy1703NJFmyw=; b=0yJssamy/lmAN0LF0TF05dkSo1muassvdn6aujCEqdMN7c2Y/iIvTAEQ86nNfIZEZM U81aTOtvJg70MaC1QFfA6gQWylLaxgwhEyeCb70T3X0gGENkDOqTWUHQhC6Jt0kt7QZC r8hg5gaa1EP39OcHjiDPwBH6i+/Spc9YE1j5HV7+K7afvDU00NF9TW5iIuFU7DQot0+Y no5/+kz3Ap4EJVywRy+WHBTbwtnDXSMB4qTiV6H+CmCPrw3hmgJCxjbjmVEG8AZk7Sto lDvdWJlDOEK6Sw6PupBPqRzL+3Gi8LievWXJULc2xEMG+1KBdwv8R4osGNehDRV5QQEi FN3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cHE79bQz76nw7VlW8H/3FDgY4UV216xJy1703NJFmyw=; b=EpttGptOF0d8HY8V3iYWHpJADaP2byN2B0qP852vHCK73n4rHEdRgUAEkqOAzmM31O vgUIS8lpryxDqxjHHUTNArLMF0f2sZKwcDjQRxFoCMi+7J1fUd5wKH4z/WuL3T0VAven BNuW0sz8ZypUisRC/oIK8ksz4OjA7G7zOyWCHqR0pUjrFmkPA+ce2M/zUi8vAANf3wXB mNElu7XQ9v846xRuLEYKFSbPZg7LLVcZrDkVyy5Dzv0hM7ODYk3NuyLbNQ3P+oWtqPBN KwU8TzClpO/k+Z0s0+i5Dq6GycxhM0L2teHwxrsCLLMfgQKKXHoM5Jj03Cd0nLOdWXld YHzA== X-Gm-Message-State: AJcUukfmu1H4BVxtC3f324cspKh1tLjnE7PEEPy1CmTj98tPKNfnENzB S5cJanD3tFW3QI4r1swUyyZNDtINZK/mrByvs4n91roYePjVC0x6hoNdvfHoEDDbXB9hUSbbrE/ FNVvw2rLPBzOCGxadnK3uWBOsvwySjjXXx5liWuSUZiHj/UDWSy98Yrjv3moUA25Us2jmM6M3bb ZLmzn3scBOHg== X-Google-Smtp-Source: ALg8bN6AW4YwlGq2QW/shyOHfhgBu5XvU+I5maGk66jxhZMK5cPgUXrqAmumsqeIkTEHwgE4FT0XtQ== X-Received: by 2002:ac8:30ac:: with SMTP id v41mr3039461qta.51.1548261860415; Wed, 23 Jan 2019 08:44:20 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id m41sm90037441qtc.58.2019.01.23.08.44.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Jan 2019 08:44:19 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 9BF1CA74; Wed, 23 Jan 2019 13:44:17 -0300 (-03) Date: Wed, 23 Jan 2019 13:44:17 -0300 From: Alvaro Herrera To: tcassidy@mossridge.com.au, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15602: pg_dump archive items not in correct section order Message-ID: <201901231644.rh46t3asx75y@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5ydg5k6k22gbawuz" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <15602-e895445f73dc450b@postgresql.org> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5ydg5k6k22gbawuz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2019-Jan-22, PG Bug reporting form wrote: > When I run pg_dump on a database, it reports the following warning: > > pg_dump: [archiver] WARNING: archive items not in correct section order > > > The following SQL script replicates the warning when run on a new instance > of PostgreSQL 11.1: It does indeed ... curious. repairDependencyLoop sees this curious case involving ten objects: repairing loop: 10 (mv_2 [type 12], _RETURN [type 17] (on mv_2), table1_pkey [type 19], POST-DATA BOUNDARY [type 37], foo [type 23], PRE-DATA BOUNDARY [type 36], _mv_1 [type 25], mv_1 [type 25], mv_1 [type 12], _RETURN [type 17] (on mv_1)) (I just patched it to print the loop objects as attached) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --5ydg5k6k22gbawuz Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="dump-sort.patch" diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c index 08005c530f..e17d05d88b 100644 --- a/src/bin/pg_dump/pg_dump_sort.c +++ b/src/bin/pg_dump/pg_dump_sort.c @@ -876,6 +876,18 @@ repairDependencyLoop(DumpableObject **loop, int i, j; + fprintf(stderr, "repairing loop: %d (", nLoop); + for (i = 0; i < nLoop; i++) + { + fprintf(stderr, "%s [type %d]", loop[i]->name, loop[i]->objType); + if (loop[i]->objType == DO_RULE) + fprintf(stderr, " (on %s)", ((DumpableObject *) + (((RuleInfo *) loop[i])->ruletable))->name); + if (i < nLoop -1) + fprintf(stderr, ", "); + } + fprintf(stderr, ")\n"); + /* Datatype and one of its I/O or canonicalize functions */ if (nLoop == 2 && loop[0]->objType == DO_TYPE && --5ydg5k6k22gbawuz--