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 1tmUfC-00762w-U6 for pgsql-general@arkaria.postgresql.org; Mon, 24 Feb 2025 09:22:11 +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 1tmUfC-00HabL-8L for pgsql-general@arkaria.postgresql.org; Mon, 24 Feb 2025 09:22:10 +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 1tmUfB-00HabD-TG for pgsql-general@lists.postgresql.org; Mon, 24 Feb 2025 09:22:09 +0000 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tmUf9-000VPZ-1T for pgsql-general@lists.postgresql.org; Mon, 24 Feb 2025 09:22:09 +0000 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-5fcd50841f4so1946445eaf.0 for ; Mon, 24 Feb 2025 01:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740388926; x=1740993726; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QAMo7mGnV5trFg0fthRf5B2x+Kbg2y4c9TZTTI5X0K8=; b=VQOjD5nklRhv0hqf4XGUru7RnyDNpGfTpFPwytKItGF1fwFvy52b4DdzdYI5KPtToy stbdVZI1RWgOO5k9DmXYPiEwZd8UE4dI7WnVP6NSVO7vvqt2VKDBEfeu3VoMXuZ3Bdtm IYVTOu7+Upj6LrjjMU/Eltzr4C20JldmxGJ7B9RnO5l+4osllx++dB6wf8NB1//6CNxn qZUxGCojheU8s6TlB4hnELT4a9698H860K82Pt8cL20AS3CxUKg1P2+409L5Bwo1nhe1 VLPQL5p88TMkD8YK8wkfJKzq3kg1Cx5l1VT9DDXCi2d3t6af/p3GjwmuVVnRX3YlVkwe ngXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740388926; x=1740993726; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QAMo7mGnV5trFg0fthRf5B2x+Kbg2y4c9TZTTI5X0K8=; b=Fb0OTycmxaDijzNA+0fL335M+zVKWwCVywP8w2L+g/hwr6zROJnmcs2boZpHFBb43/ YS1bObOKYEfx9B5klCUxNVy0mAmL6UHUUMz12m8xZdvNKOkejfW3i756qvgfUkvDl5BF oIWMNJKW0MyyvAh91g+JnVuusvW09DeXs0cwzIb88+KBPpUxMfWTl6KXgra5awxouc8U VWc10yMpUHwfbs9WwuEwpOKttyLJODJVia20Dge25NWeuLGrVCQWwzZYgP4LASryeLyR GDKu2zVVpnMI8SzEk9YfM3rKGiwLzgeG7V6CcYBTvfMzRaEoW8Z0xIbO/a2dN32x2iOs lrmg== X-Gm-Message-State: AOJu0YwMcpRZfGU21RbYHLCgX0dz74hW5pU+EhfkN8B9wTrQbFRwVmWH hJaYAvFbTg4uvI2o4frjCnj2/qvyvV/EKWAGMXZZQzgTL7G03LPfy66VTy3kAMHZs7IDM2O3jNJ 6TQLRvTDVg6zUb766etO5yKiR21Qjsiqu X-Gm-Gg: ASbGncvKLB+B3V089Sa1x0L4PAkA97Xb1+6zwrdqTO3yjCQ6XukL23Sthcv9syuHp7h lFxVAnlq8OS73Jjdh1JIW55Xj54diMldFBj0DgiAx34EH9YvSIz354CzjS9hAyMoBqOnnpYjYMi CnuQOIkmYjJw== X-Google-Smtp-Source: AGHT+IFnFE3W3VZ/EEyBt5obbTNVx0NE9/aaVIaKnLQtOM7tbIIPdCb0hVG+R1WzAayoY77RE08gNvdgpjOFxBFGfO0= X-Received: by 2002:a05:6808:4481:b0:3f4:22b4:e4b4 with SMTP id 5614622812f47-3f4246c0c3bmr10745368b6e.13.1740388925930; Mon, 24 Feb 2025 01:22:05 -0800 (PST) MIME-Version: 1.0 References: <2701260.1740065273@sss.pgh.pa.us> In-Reply-To: <2701260.1740065273@sss.pgh.pa.us> From: Dominique Devienne Date: Mon, 24 Feb 2025 10:21:50 +0100 X-Gm-Features: AWEUYZlCfljrEHOxSb5CrY9tUW9mabbIOkAG6mgtCMdDiklpMroFismsfW0TSHs Message-ID: Subject: Re: #XX000: ERROR: tuple concurrently updated To: Tom Lane Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000b384df062edfdfee" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b384df062edfdfee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 20, 2025 at 4:27=E2=80=AFPM Tom Lane wrote: > Dominique Devienne writes: > > Error: DDL Error: GRANT USAGE ON SCHEMA "SCH1", "SCH2" TO "SCH2:RO", > > "SCH2:RW", "SCH2:SU": #XX000: ERROR: tuple concurrently updated > > Since both restores tried to grant some permissions on SCH1, they > both had to update SCH1's pg_namespace row (specifically nspacl). > We have no support for concurrent updates in the catalog-manipulation > code, so if the second run arrives at that step before the first > one has committed its pg_namespace change, you get this error. > Hi Tom, and al. I have a related question, on role-to-role grants this time. Above, it was contention on pg_namespace.nspacl in two transactions. But during those "restore" transactions, I must also make role-to-role grants, which AFAIK involve adding rows to pg_auth_members. So they are not subject to the same "no support for concurrent updates in the catalog-manipulation" you mentioned, as schema-to-role grants are, right? Because that's an insert, not an update? Just want to make sure, as I'm thinking how to change our code. Thanks, --DD --000000000000b384df062edfdfee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Feb 20, 2025 at 4:27=E2=80=AFPM T= om Lane <tgl@sss.pgh.pa.us> = wrote:
Dominique Devienne <ddevienne@gmail.com> writes= :
> Error: DDL Error: GRANT USAGE ON SCHEMA "SCH1", "S= CH2" TO "SCH2:RO",
> "SCH2:RW", "SCH2:SU": #XX000: ERROR:=C2=A0 tuple c= oncurrently updated

Since both restores tried to grant some permissions on SCH1, they
both had to update SCH1's pg_namespace row (specifically nspacl).
We have no support for concurrent updates in the catalog-manipulation
code, so if the second run arrives at that step before the first
one has committed its pg_namespace change, you get this error.

Hi Tom, and al.

I have a r= elated question, on role-to-role grants this time.

Above, it was contention on pg_namespace.nspacl in two transactions.
=

But during those "restore" transactions, I mu= st also make role-to-role grants,
which AFAIK involve adding rows= to pg_auth_members. So they are not subject
to the same "no= support for concurrent updates in the catalog-manipulation"
you mentioned, as schema-to-role grants are, right? Because that's an = insert,
not an update? Just want to make sure, as I'm thinkin= g how to change our code.

Thanks, --DD
= --000000000000b384df062edfdfee--