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.96) (envelope-from ) id 1wKDNm-000jMY-2J for pgsql-bugs@arkaria.postgresql.org; Tue, 05 May 2026 10:52:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKDNk-00BbbJ-04 for pgsql-bugs@arkaria.postgresql.org; Tue, 05 May 2026 10:52:04 +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.96) (envelope-from ) id 1wKDNj-00Bbau-1p for pgsql-bugs@lists.postgresql.org; Tue, 05 May 2026 10:52:03 +0000 Received: from mail-dl1-x122b.google.com ([2607:f8b0:4864:20::122b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wKDNd-00000000ISl-3Jbd for pgsql-bugs@lists.postgresql.org; Tue, 05 May 2026 10:52:02 +0000 Received: by mail-dl1-x122b.google.com with SMTP id a92af1059eb24-130c653cce4so667211c88.1 for ; Tue, 05 May 2026 03:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777978317; cv=none; d=google.com; s=arc-20240605; b=TQoB9pfAXGfASNeCPnkgCPvkGpcC/flsg19y2GHb5dKWyXmTuQFowYgLuMdjPREzrY THxBh9eCaifcorf+qu6CQ+HmcAvZk8l1yTiUJxAH1IZqtxZPUAFNeugFH1PEio3ta5pC g8KPNPnifknkSC5vriJdmGYAg+GFccKnmmL5FauD29nrsl2csQuvAg+njDyX0zE1YGw/ r0s49Xk49SOPVfLg5ET+jUWYzLUNQ9l0aPer5L73w7tMNr5gEn/Omsf/2+3fCMIoIGdB 0rilVLDF7Q5dp3LU5weNqkFQnGa3oA+Ri7kJxolBg6t0UXhF9M6lzIGr2/tZPuKw4SNh SWKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=Y658rlIkPHBZsg2XMcch7D1ehvzrytClf76FaaFh9mQ=; fh=NLSfCAF4hj36+RbV53a1hma4i3QzKJl+7rL8DmSNhzk=; b=AZB99bu5vhd/z7IecLqgim6oRM3ZRJprILB92LodJ60m+2vQAVbcqqZ69B4k1R4Vh9 sX0NzLU0qKP6yl8R9W3khi83fMStBPa+mGKyJn+XBP729bz2uwpqMEsGbheV83mkFQgq SHhLV99QX7ETygJExSo9/3E5koPvAc7N6OTpWef7j7axKYxx19NpRPBqcx9CrfRZA7gY iN8D413d4Zd9zgmQ+325mmkRankqHraFOsFQZnLRSUxaUDPaDsaW1YDPnJWBx5sHK0Cf 105YeyNuIQ1ABhCwhFXAiLToIQo1P3dfO/1IObLM91wdaj94WW0TwOe8/mrRbHcO5/qB VPdA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; t=1777978317; x=1778583117; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Y658rlIkPHBZsg2XMcch7D1ehvzrytClf76FaaFh9mQ=; b=duk2yPgg4arDOxI036iWIYy5yRmhpH3JC9zd5NhAGeAfEayB5JpUy+aHmiOQFdwxhT 0jfdlebUbJX4EP06pZZjOUg50Ms5S0pRi9uRTDAsqJelKcM7VPdms8zU4/Vtuct4lTuP vksXfrAu3N2iJ108FJC0oB2X/LQlqEaZMxvLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777978317; x=1778583117; h=cc:to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y658rlIkPHBZsg2XMcch7D1ehvzrytClf76FaaFh9mQ=; b=a0K8qkz2WEIR1iUK0l30mvY/r2Ywslythbk1dds3bbAdQYUGEhZPHPX46XVAMhOgff HM9Mg+lBF1pGHXBTu8zex0Xfa0RycFi409Jb2WEzmF/TKzZ/OSNr4MDq+fuCrqX5zqGS xh3T2MWtKtM1hUiU2xutJxh/Bgpp56TFWPrZgACaEcurW7qfjdfhVgFmeK7Se61AQ8A8 7I80NNOStGw3XPda0j0lBcDlU69Ubz3Ph7YOKYocIijvMWWlpZeEHTklmsgqmD9mhHAl GV98KmMLLSbT7AM1Dh+UGr0tutsfjLL/lwL9zuBfc6qsPZ2z8FRpK7OLfb5Dtr+DrzSU hO4g== X-Gm-Message-State: AOJu0YwydfAuDR82m0CvFu/0jH0J70cP0zQEIJfP0OuTjnUUQfrgfgEy kj34t8HIXbPf9ulh8V4nMHKCxZR5ByuOp+7KLS2ewL+cyHMwUeBBqM6c8DGVRIxLBuaL9jLLHx/ qnbRZNgQE4MOx3JKge89XgYxTdYpbDalGdOfUGi1Kp7PLqAjQvGTdECI= X-Gm-Gg: AeBDiesLnnMJclVe8P5WiUsM8BUQaH2AZfVb81q4HsYD+B6hVmRl2LOcYls/BDcoXJB bYnVE0sIuu2g8FlGKpFsuBKWVyyVWoe52r4xOsw4WAiacyFq3UgCSBYo5iiUH9uml3BxoFw5kxs NrNLxJVKMXBS5ZzJzxRZ4KcVOD1zmN84qIb1rC2Fq3QDsiOZ7N9ANqAbvqGuyA1TPAWW4wQwvsd uajfEJHHLAkK2+u2/VsfxC29NnAy48dl3EPaNgRBBqddOA8XC8XN5ELrM0ggWxI80D9Kg2KQ23q 97z5In9k0GImHziR4Ifr2S7RGoCNcRuNonmp8dIF+Qyh4yK4yQbm X-Received: by 2002:a05:7022:1288:b0:12d:de3f:d849 with SMTP id a92af1059eb24-12dfd884381mr6274013c88.44.1777978316593; Tue, 05 May 2026 03:51:56 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?w4FsdmFybyBSb2Ryw61ndWV6?= Date: Tue, 5 May 2026 12:51:44 +0200 X-Gm-Features: AVHnY4Iz09GBFPom0Vq_rHGYJ97veA2riuDpg07HeTz76satnF8pp0T8WRDgl60 Message-ID: Subject: pg_dumpall can't be restored with different bootstrap superuser To: pgsql-bugs@lists.postgresql.org Cc: Javier Maellas , Diego Revenga Content-Type: multipart/mixed; boundary="000000000000fb3f6406510fd515" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fb3f6406510fd515 Content-Type: multipart/alternative; boundary="000000000000fb3f6306510fd513" --000000000000fb3f6306510fd513 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi there, We have hit an issue with pg_dumpall --roles-only where the role grants to other roles can't be reapplied in a clean database, if the bootstrap superuser does not have the same name in both databases. The problem is that dumpall generates a statement such as this: GRANT a TO b WITH INHERIT TRUE GRANTED BY postgres; However, if postgres is merely a superuser and not the bootstrap superuser, this fails because, from the docs, "The role recorded as the grantor must have ADMIN OPTION on the target role, unless it is the bootstrap superuser". *Environment* - PostgreSQL 18.3 (Debian 18.3-1.pgdg13+1), official postgres:18 Docker image - Host: macOS (Darwin 25.4.0), Docker 29.4.1 *Steps to reproduce* 1. Start two Postgres 18 containers with different superusers: docker run -d --name pg18-postgres \ -e POSTGRES_USER=3Dpostgres -e POSTGRES_PASSWORD=3Dpostgres \ -p 5432:5432 postgres:18 docker run -d --name pg18-notpostgres \ -e POSTGRES_USER=3Dnotpostgres -e POSTGRES_PASSWORD=3Dnotpostgres \ -p 5433:5432 postgres:18 2. On the source container, create two roles and grant one to the other: docker exec pg18-postgres psql -U postgres \ -c "CREATE ROLE role_a;" \ -c "CREATE ROLE role_b;" \ -c "GRANT role_a TO role_b;" 3. Dump roles only and save to a file (attached): docker exec pg18-postgres pg_dumpall -U postgres --roles-only > dumpall .sql 4. Replay the dump against the second container: cat dumpall.sql | docker exec -i pg18-notpostgres psql -U notpostgres Expected: restore succeeds Actual: ERROR: permission denied to grant privileges as role "postgres" DETAIL: The grantor must have the ADMIN option on role "role_a". Thank you, =C3=81lvaro Rodr=C3=ADguez --000000000000fb3f6306510fd513 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi there,

We have hit an issue with pg_dumpall --ro= les-only where the role grants to other roles can't be reapplied in a c= lean database, if the bootstrap superuser does not have the same name in bo= th databases. The problem is that dumpall generates a statement such as thi= s:

GRANT a TO b WITH INHERIT TRUE GRANTED B= Y postgres;

However, if postgres is merely a = superuser and not the bootstrap superuser, this fails because, from the doc= s, "The role recorded as the grantor must have ADMIN OPTION on the tar= get role, unless it is the bootstrap superuser".=C2=A0

<= /div>
Environment
=C2=A0 - PostgreSQL 18.3 (Debian 18.= 3-1.pgdg13+1), official postgres:18 Docker image
=C2=A0 - Host: macOS (D= arwin 25.4.0), Docker 29.4.1

Steps to reproduce=
=C2=A0 1. Start two Postgres 18 containers with different su= perusers:
=C2=A0 docker run -d --name pg18-post= gres \
=C2=A0 =C2=A0 -e POSTGRES_USER=3Dpostgres -e POSTGRES_PASSWORD=3D= postgres \
=C2=A0 =C2=A0 -p 5432:5432 postgres:18

=C2=A0 docker r= un -d --name pg18-notpostgres \
=C2=A0 =C2=A0 -e POSTGRES_USER=3Dnotpost= gres -e POSTGRES_PASSWORD=3Dnotpostgres \
=C2=A0 =C2=A0 -p 5433:5432 pos= tgres:18

=C2=A0 2. On the source container, create two roles and = grant one to the other:
=C2=A0 docker exec pg18= -postgres psql -U postgres \
=C2=A0 =C2=A0 -c "CREATE ROLE role_a;&= quot; \
=C2=A0 =C2=A0 -c "CREATE ROLE role_b;" \
=C2=A0 =C2= =A0 -c "GRANT role_a TO role_b;"

=C2=A0 3. Dump roles o= nly and save to a file (attached):
=C2=A0 docke= r exec pg18-postgres pg_dumpall -U postgres --roles-only >=C2=A0<= span style=3D"font-family:monospace">dumpall.sql
=C2=A0 4. Replay the dump against the second container:
= =C2=A0 cat dumpall.sql | docker exec -i pg18-notpo= stgres psql -U notpostgres

Expected:= restore succeeds
Actual:=C2=A0 =C2=A0
=C2=A0 ERROR: =C2=A0permission denied to grant privileges as role = "postgres"
=C2=A0 DETAIL: = =C2=A0The grantor must have the ADMIN option on role "role_a".

Thank you,
=C3=81lvaro Rodr=C3=ADguez
--000000000000fb3f6306510fd513-- --000000000000fb3f6406510fd515 Content-Type: application/octet-stream; name="dumpall.sql" Content-Disposition: attachment; filename="dumpall.sql" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mosi9plu0 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBjbHVzdGVyIGR1bXAKLS0KClxyZXN0cmljdCB6SE9X cGVySDBlazNhRTN1T3FJeG9yMnZXRXNWd2JBT2xNaHVBYTltYzh3TEczWEhoMzdMd1VIWW1aSklP OVkKClNFVCBkZWZhdWx0X3RyYW5zYWN0aW9uX3JlYWRfb25seSA9IG9mZjsKClNFVCBjbGllbnRf ZW5jb2RpbmcgPSAnVVRGOCc7ClNFVCBzdGFuZGFyZF9jb25mb3JtaW5nX3N0cmluZ3MgPSBvbjsK Ci0tCi0tIFJvbGVzCi0tCgpDUkVBVEUgUk9MRSBwb3N0Z3JlczsKQUxURVIgUk9MRSBwb3N0Z3Jl cyBXSVRIIFNVUEVSVVNFUiBJTkhFUklUIENSRUFURVJPTEUgQ1JFQVRFREIgTE9HSU4gUkVQTElD QVRJT04gQllQQVNTUkxTIFBBU1NXT1JEICdTQ1JBTS1TSEEtMjU2JDQwOTY6elMwQThRSTROUjNq R1RwWVNlRk43dz09JFpnSjhsdER2a253YlBQZDlpNWxrUy9kQ1JqK2NhNm9GMTB0bzNVZWExNzg9 OmxpV2VYWEhFYjJkYTFSYmZRZERneElUbmRQc2RYRGlKTXJ0SmJKSnY5S3M9JzsKQ1JFQVRFIFJP TEUgcm9sZV9hOwpBTFRFUiBST0xFIHJvbGVfYSBXSVRIIE5PU1VQRVJVU0VSIElOSEVSSVQgTk9D UkVBVEVST0xFIE5PQ1JFQVRFREIgTk9MT0dJTiBOT1JFUExJQ0FUSU9OIE5PQllQQVNTUkxTOwpD UkVBVEUgUk9MRSByb2xlX2I7CkFMVEVSIFJPTEUgcm9sZV9iIFdJVEggTk9TVVBFUlVTRVIgSU5I RVJJVCBOT0NSRUFURVJPTEUgTk9DUkVBVEVEQiBOT0xPR0lOIE5PUkVQTElDQVRJT04gTk9CWVBB U1NSTFM7CgotLQotLSBVc2VyIENvbmZpZ3VyYXRpb25zCi0tCgoKLS0KLS0gUm9sZSBtZW1iZXJz aGlwcwotLQoKR1JBTlQgcm9sZV9hIFRPIHJvbGVfYiBXSVRIIElOSEVSSVQgVFJVRSBHUkFOVEVE IEJZIHBvc3RncmVzOwoKCgoKXHVucmVzdHJpY3QgekhPV3BlckgwZWszYUUzdU9xSXhvcjJ2V0Vz VndiQU9sTWh1QWE5bWM4d0xHM1hIaDM3THdVSFltWkpJTzlZCgotLQotLSBQb3N0Z3JlU1FMIGRh dGFiYXNlIGNsdXN0ZXIgZHVtcCBjb21wbGV0ZQotLQoK --000000000000fb3f6406510fd515--