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 1tifKl-000wJX-R5 for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2025 19:57:16 +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 1tifKj-00DTPD-3R for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2025 19:57:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tifKi-00DTP3-LS for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2025 19:57:13 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tifKh-000fmL-0T for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2025 19:57:12 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4396424d173so9687925e9.0 for ; Thu, 13 Feb 2025 11:57:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739476629; x=1740081429; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Y0mKgTtYhNIxhPEZQhqvea5h7RAtRlnrEv60ZeLVFbU=; b=MrEo77HE0fVO/2/Ww3ViBNsuJa0GIgohztA8khGbt7ILyeEIhirfjUv3nL+Sz6oKjw 1ENdfpkJ4ptoz7qpJVOJGzRvflhJDvR6NnzSenaW6lm+S4YbWQpNSMIW+xDPELH/jlXw PHz0TPiV1oVuQJMgGoEiPsZW6SOyUTMmqBogALSYkNf1PlTeHG61C4Y7KV/qZAv4ibSh wOIcKQfUDGsFNOyuKpf5HhI3iHbxtg/r+bdBO5MZ/O1qvXetH8E9NHKFlib2QPevWap7 fcFbDQzh3h0BszAHTFWGhDVJ3lbkbbka7zShZTAx86nItYcSNELbxENA3wE+A7PeH9Wt EZpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739476629; x=1740081429; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y0mKgTtYhNIxhPEZQhqvea5h7RAtRlnrEv60ZeLVFbU=; b=k7zZCKsqDmABbfQH3Egwde5uI4KTC/hxJKiwqNxm6o4cLj2dNCcjOs05xPYiGW/UUf v1AEq0rdZ3R7enXp5nnM2liEvvdmQ1CIjBE5f2QfG2H/HX5Rr8srlTDkX89+zhGYwlsf a1X//n0C+cy7TDaWi/kGY+AdAcnNKg63+f0rJFPwWIFFUgZwmbOwszskWlP0ZlW746Lm H1sltB2jREPGkTz3VoGjLOdRq52HKZooeDMQml/mim8Oa5mLUZtRvFy9ytGwyHwiNs/j Df41PzzKKFoCzMipOP6ZWyKOpVw7VXpJKmtrKkVa8s5ed5VxfgvMPjfafb8SOx1XLRnj OORQ== X-Gm-Message-State: AOJu0YzfNmasATn0av/aKfvVcJxUAv0++was1Q32hTHKRtXtfjNzJLwE 9SvjFHporTR4jzPAapBq6ab7L7EEU2qY7GaH25hfIHAY0DhIr4oTf5FvWA== X-Gm-Gg: ASbGncsCj4BWd2hLYUpnZz/uRr4xCftxqtwuEE5wbfm1iBgG18FGSztTtxZVXG+R1hw JFeD4BLygtTSpgXkgXQliJSMfXY6P0K6GAbhLhfeFaWBfulgHtdyp3eVdocVIymHMqOPBUV8UMe l4iBBltXzA6gMor8Ed0bieEaS9KvJ3ZDzr7MAm2d2FlBiTGFzlFBM1k2AYMYyH6WwucG3haZyQS uAptAuZNa7vXPtKQUKBXFB+Q8KRkhA9ve+Do+utexskiMQHM/BSZJxLTv0cstrT7iB0wilLqlZo wLRf7aVudsZIzsyFl7Eb22i5XpTXmPkPk2khl+XH1JFtIQFIGW3VOOkfARh6umqUv9qx X-Google-Smtp-Source: AGHT+IH2pjNL0QxvrpYEQgjBIK7OoLjRxF7ukugGep4ozV+G8+Xs76/lnkFsFMDa7Ue+ELkKYWtZIQ== X-Received: by 2002:a05:600c:3b9e:b0:439:40c1:1343 with SMTP id 5b1f17b1804b1-43960191549mr67157385e9.15.1739476628804; Thu, 13 Feb 2025 11:57:08 -0800 (PST) Received: from smtpclient.apple (143-45-239-77.dyn.cable.qlnet.ch. [77.239.45.143]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439615e543asm26873845e9.0.2025.02.13.11.57.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Feb 2025 11:57:08 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: libc to libicu via pg_dump/pg_restore? From: Paul Foerster In-Reply-To: <159fd473-e361-4b60-9d62-5cf617bc4be1@aklaver.com> Date: Thu, 13 Feb 2025 20:57:00 +0100 Cc: pgsql-general list Content-Transfer-Encoding: quoted-printable Message-Id: References: <187f2c5d-f268-4596-bb63-c94790ae761d@aklaver.com> <99d51fe7-c6d2-4421-9456-07ed1f5703a2@aklaver.com> <5A9148A0-CF9C-4841-A9C0-D7E299AC4ADD@gmail.com> <0150a3d8-9276-4534-9847-8d3d7bba6e16@aklaver.com> <159fd473-e361-4b60-9d62-5cf617bc4be1@aklaver.com> To: Adrian Klaver X-Mailer: Apple Mail (2.3826.400.131.1.6) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Adrian, > On 13 Feb 2025, at 19:05, Adrian Klaver = wrote: >=20 > Then run pg_restore -s -f db_name.sql against whatever is the dump = file produced by pg_dump -Fc -Z1 ... >=20 > It will create a plain text version of the schema definitions, no data = in the file db_name.sql. Then you can see if GRANTs are being done. I think, we're not talking about the same thing. I'm talking about = access privileges on the database, i.e. connect, create, etc. Without a = connect privilege, no schema privileges are relevant in the first place. > This only shows the information the actual database object not the = objects contained within it. Yes, this is what I am referring to, the access privileges on the = database, not objects. > You will need to show your work: > 1) What does \l show in the cluster you are dumping from? > 2) What are the roles and what privileges are they being granted? I'm not at work anymore and won't be until Monday (long weekend =F0=9F=A4=A3= ). So I don't have the exact case handy. However, I tried on my home = database clusters (15.10 and 17.3). Seems, at least here at home, only = using -C works. I don't know (yet) why it does not work at work. Here's what I tried on my own clusters. Note the access privileges for = "paul". Source DB PostgreSQL 15.10 -------------------------- postgres=3D# \l mydb List of databases Name | Owner | Encoding | Collate | Ctype | ICU Locale | = Locale Provider | Access privileges =20 = ------+----------+----------+-------------+-------------+------------+----= -------------+----------------------- mydb | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | = libc | =3DTc/postgres + | | | | | | = | postgres=3DCTc/postgres+ | | | | | | = | paul=3DCTc/postgres (1 row) $ export PGDATABASE=3Dmydb $ pg_dump -Fc -Z1 --quote-all-identifiers -b "${PGDATABASE}" -f = ${PGDATABASE}.dump.gz No output, no error messages. Everything is fine. Target DB PostgreSQL 17.3 ------------------------- postgres=3D# create role paul login; CREATE ROLE postgres=3D# create database mydb template template0; CREATE DATABASE postgres=3D# \l mydb List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype = | Locale | ICU Rules | Access privileges=20 = ------+----------+----------+-----------------+-------------+-------------= +--------+-----------+------------------- mydb | postgres | UTF8 | icu | en_US.UTF-8 | = en_US.UTF-8 | en-US | |=20 (1 row) $ pg_restore -C -d mydb mydb.dump.gz=20 pg_restore: error: could not execute query: ERROR: database "mydb" = already exists Command was: CREATE DATABASE "mydb" WITH TEMPLATE =3D template0 ENCODING = =3D 'UTF8' LOCALE_PROVIDER =3D libc LOCALE =3D 'en_US.UTF-8'; pg_restore: warning: errors ignored on restore: 1 postgres=3D# \l mydb List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype = | Locale | ICU Rules | Access privileges =20 = ------+----------+----------+-----------------+-------------+-------------= +--------+-----------+----------------------- mydb | postgres | UTF8 | icu | en_US.UTF-8 | = en_US.UTF-8 | en-US | | =3DTc/postgres + | | | | | = | | | postgres=3DCTc/postgres+ | | | | | = | | | paul=3DCTc/postgres (1 row) So, "paul" again has CTc after pg_restore. That's what does not work at = work. I'll have to figure out what's wrong there. Cheers, Paul=