Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uU5XS-00FNmF-Ku for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jun 2025 15:26:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uU5XQ-00D4Fu-AF for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jun 2025 15:26:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uU5XQ-00D4Fm-0l for pgsql-hackers@lists.postgresql.org; Tue, 24 Jun 2025 15:26:20 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uU5XN-003kaB-38 for pgsql-hackers@lists.postgresql.org; Tue, 24 Jun 2025 15:26:19 +0000 Received: from [192.168.11.9] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id D89E36059D for ; Wed, 25 Jun 2025 00:26:12 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Content-Type: multipart/mixed; boundary="------------UdoPnlTJ0T7MIgbyecXzCT0i" Message-ID: <08129593-6f3c-4fb9-94b7-5aa2eefb99b0@oss.nttdata.com> Date: Wed, 25 Jun 2025 00:26:12 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: pgsql-hackers@lists.postgresql.org From: Fujii Masao Subject: pg_dumpall dumps global objects with --statistics-only or --no-schema List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------UdoPnlTJ0T7MIgbyecXzCT0i Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, While testing pg_dumpall in v18, I noticed that it still dumps global objects such as roles and tablespaces even when --statistics-only or --no-schema is specified. This seems unexpected. Since pg_dumpall treats global objects as schema-level content, it currently includes them with --schema-only but skips them with --data-only. By that logic, it should also skip them when either --statistics-only or --no-schema is used. Thought? Attached is a patch to fix this behavior. Originally, I planned to work on this after we settled the ongoing discussion about pg_dump options in [1], but since that may take some time, I wanted to bring this up now so I don't forget the issue. Regards, [1] https://postgr.es/m/7cc52488-f876-4ad3-affd-6e4b0ef0cb09@eisentraut.org -- Fujii Masao NTT DATA Japan Corporation --------------UdoPnlTJ0T7MIgbyecXzCT0i Content-Type: text/plain; charset=UTF-8; name="v1-0001-pg_dumpall-Skip-global-objects-with-statistics-on.patch" Content-Disposition: attachment; filename*0="v1-0001-pg_dumpall-Skip-global-objects-with-statistics-on.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBhM2NkN2M3NmY0NTYxNDRjNjJlMzY1MmNmM2VkZDc3ZDJkOGQzODE2IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBGdWppaSBNYXNhbyA8ZnVqaWlAcG9zdGdyZXNxbC5v cmc+CkRhdGU6IFR1ZSwgMjQgSnVuIDIwMjUgMjM6NTY6MjggKzA5MDAKU3ViamVjdDogW1BB VENIIHYxXSBwZ19kdW1wYWxsOiBTa2lwIGdsb2JhbCBvYmplY3RzIHdpdGggLS1zdGF0aXN0 aWNzLW9ubHkgb3IKIC0tbm8tc2NoZW1hLgoKUHJldmlvdXNseSwgcGdfZHVtcGFsbCB3b3Vs ZCBzdGlsbCBkdW1wIGdsb2JhbCBvYmplY3RzIHN1Y2ggYXMgcm9sZXMKYW5kIHRhYmxlc3Bh Y2VzIGV2ZW4gd2hlbiAtLXN0YXRpc3RpY3Mtb25seSBvciAtLW5vLXNjaGVtYSB3YXMgc3Bl Y2lmaWVkLg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