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 1wYMX8-000D9w-0o for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jun 2026 11:28:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wYMX5-003Wc6-0l for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jun 2026 11:28:11 +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 1wYMX4-003Wbo-1Q for pgsql-hackers@lists.postgresql.org; Sat, 13 Jun 2026 11:28:10 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wYMX2-000000009RJ-3E4H for pgsql-hackers@lists.postgresql.org; Sat, 13 Jun 2026 11:28:09 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-c85d4b4245aso1296057a12.1 for ; Sat, 13 Jun 2026 04:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781350086; cv=none; d=google.com; s=arc-20240605; b=jJAZ/RxUaZ4BbRrv00wqreX0ylw1/5oitIjNhG/cRLbyao9FidN9um6KsvV3Qk9nJ7 jVIF6UvC3Lg1j61BIL1ZaJw9tOee8M7o1XjVxWZ8YASpJL9GvUY7rUDKVPE3XoQw4naE 5e6KKPgyv8yx4KR8TphGVf2Gkn6zHFzwDScGuMPo1Wn8QMt1mzwtCI5rJ0dwNdxzkVMa DnC/aYPvyQQqv9Kfrll6FzLdpfLP9EQ+YvgXqfKRYUIKcMm3c4/rMm4a+/pjs5ccylmV Z1zlkPlgnZ9sdjQPhwMwk5lj4AM99JolM3UN2X5NOeJGVXhpAsBwzNNQIgGYTI1OEnBn w0tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Lv4+9PY34xEBWlH1J7X2A9KfGQl6auebSXw/XlwkIHc=; fh=532m1OUApbUHwc2d9Z63FnoD+GpXtfn1ZZLzhBbEmVw=; b=MH3dj2xW2FpuZWxTXSKfaC45fhTjOTK9iJ2dijbKL5G5rjpwOeXrBxW31i0Wj1Us6W E5KmgxY4r+9wrH9dZd6WXqllSgg68eleSlqPJVCHl3iFXjQ8e1kM7te5YNhhG9gm0y1c fZhJXbLxvZG6g+uFUpKOdl84WJPdtFMutDJ216OoYoQlw6ofq2EVp/MgZ9tSf3YSuRZr zisAFwdtmcGTNWv91RzHTjOBtaohXExTHc783+W7gTW3t4z9jCBA+VeemMqLDImrL1/f iyfbH6jx1VyWKuOWOWRW7u4Pc8p6SYMCkselhl1NW7dqPn6kP3io/pI7u7s7IMJG8ZIC uDNg==; 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=gmail.com; s=20251104; t=1781350086; x=1781954886; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Lv4+9PY34xEBWlH1J7X2A9KfGQl6auebSXw/XlwkIHc=; b=qei+Ts9LYb8GQeNCSufbRm2Tqii9cdN3s+Iv3UVJR0bt3EQ23bFMVlqWWEjq308ABi x12UdaWs4sEjcwBzzyDH4KPNpjbzUkAZ/YLEoXF2W1fEp6HRJhWlFx04w0iRESHv1iuC KvVahwQ690aT1OQv0jPRMQCgJfgNFfPtaDeYsPUOdOMxwffphAVy7/1dVr8eWYQ7/7wl cry57kweLNQBeqmH79iFSSVLZsURmecPLrE7XCeqCHbky3D3zZksD7Coe6ScxJ+t6qIt oirluxt7G8n7dQLdVdyj3pHF7hQ6O4HwfeWHxtR/iOXzqWbVRJoOd9X2PT6xFDKx2IXK S0Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781350086; x=1781954886; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Lv4+9PY34xEBWlH1J7X2A9KfGQl6auebSXw/XlwkIHc=; b=Gw26q6fRXNwxd4HUSpcqrqK32PtN6dDEN/tvHdsgP28izpxjMnTSVoKcAviDpjzXMy g6d7Ue+AH8J4ALyjZfGmmyiHDLLN/DlnNHd9JObYyYh+E8hIxTAiKwNmzrrHFPiMK9Vu 65xLXrAb+cPc6mZfepybdB9QlzK5yq1ES9nh56duNAhwgvyWm8oN2JhnyHZqlZ89/ubb VFNsL9N8TIsrudRZKQVBtHRem1bfBMOjiVO4kT9ttRvgex0Fe5Xv1l+z0qzX/N++DUFo XqXQPx+HruoDwvg3XNXlw7jQXRshm25EpA5gQzQ7ziqa/J8x7DFMISPMgwCVPla8EutK f+Mg== X-Forwarded-Encrypted: i=1; AFNElJ+PYPXpEUp0esdayfvz1zR5WaY90qktC8O+1vbfYDu1TG70XApQpFBOV4dUHPnxyiMptY3Y8vJzbqvpRXkA@lists.postgresql.org X-Gm-Message-State: AOJu0Yy3TNjkylJf/QGybS8Taqp829sS0M/ClYnvhaJpY8XwA92h0dzu LnJJwDjPV6KijtuCueI8ZXMUS/GWZxEC0UC5XmaQ9PrQajIRAhjI1qOp7avswhYAqvbFtCyQ/QZ NW47fYMOoyvcJn6UpkEDAIwmL1ZMqOs8= X-Gm-Gg: Acq92OHJy0LoxqtfMN0ATTFqcUo5rctqk2H3bpFua0KGJ0Dvb+R5ktws9oxIWE6AHIg 1YWu4jpd5Rq5/llkCxuvWgAjNPOdcY2JjnxZ+kIn84lyGM1vq+x0fsdqkTjJ41uQBGwcq4nCKYG fPJoXPqJr8HEJZYrym6cp+GRR50pXXVdDQUYoINnMAzhucaeN20qwBDKkzIsAHbZmbCAFt0Z/3n yWRZuA5sVGnK7FgXHnLzCuZqTPiVfzgXufKOnPame3j1okLMs7Wqprbq1EH5WtWEeHki0TfKFtE VIWxZXPwZnGA9FOOoNiPUm3LtrxnwlPP++aeCNjMmWtZmO0QlkBi+Co1jp/x9jLDTkPBbPIasxg 4hf/v0UsUUiip6hW2fSqI2nssB9ONHKrn2dALiOpd X-Received: by 2002:a05:6a20:1615:b0:3b4:b30e:1b4d with SMTP id adf61e73a8af0-3b79640b9ddmr3757656637.40.1781350086361; Sat, 13 Jun 2026 04:28:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Sat, 13 Jun 2026 16:57:54 +0530 X-Gm-Features: AVVi8CdJwr1hUIQt9I0YBmMKA6QJ6C41IqfWhCXEJPx-uA_rSrr3Eq5WYVSxRb4 Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: Dilip Kumar Cc: vignesh C , shveta malik , Nisha Moond , Peter Smith , Masahiko Sawada , Bharath Rupireddy , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jun 13, 2026 at 3:46=E2=80=AFPM Dilip Kumar = wrote: > > On Thu, Jun 11, 2026 at 5:53=E2=80=AFPM vignesh C w= rote: > > > > On Thu, 11 Jun 2026 at 10:44, Dilip Kumar wrote= : > > > > > > Please find the rebased patch > > > 1. It includes the new 0005 patch for reporting errors for DDLs on cl= t. > > > > > > Open comments: > > > 1. Recent comments from Nisha and Shveta after v47 are still open > > > 2. Vignesh's patch for "describe related" changes needs a rebase. Can > > > you do that, Vignesh? Meanwhile, I will close all the open comments > > > and try to share a new version by EOD today. > > > > Here is the rebased version of the patch attached. > > Please find attached the latest patch. I have reordered the series, > moving 0006 to 0002, and updated the lock restrictions. We now allow > ACCESS SHARE mode exclusively to ensure pg_dump can acquire its > necessary locks, while blocking higher-level locks to prevent > interference with insertions into the conflict log tables. > + /* + * Conflict log tables are managed by the system for logical replication + * conflicts and should not be locked explicitly. However, AccessShareLock + * is allowed to support pg_dump, which must lock tables to prevent them + * from being dropped or altered between fetching the table list and + * performing the dump. This read-only lock is safe because it does not + * interfere with concurrent insertions into the conflict log tables. + */ + if (IsConflictLogTableNamespace(get_rel_namespace(relid)) && + lockmode > AccessShareLock) + ereport(ERROR, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + errmsg("permission denied: \"%s\" is a conflict log table", + rv->relname), + errdetail("Conflict log tables are system-managed and cannot be locked explicitly, except in ACCESS SHARE mode."))); In favor of keeping this code simple, can we allow locking the CLT table with the following comment: "Note: Conflict log tables are deliberately NOT blocked here, even though other direct DDL on them is rejected elsewhere. pg_dump relies on being able to take an ACCESS SHARE lock on these tables to safely dump their definitions during binary upgrade, so we permit LOCK so we allow LOCK on them and treat them like ordinary tables here. It's true that a strong lock (ShareLock or above) on such a table would conflict with the RowExclusiveLock taken by the apply worker's insertsand could stall conflict logging for as long as it is held. But locking a system-managed conflict log table is an unusual thing to do, and it doesn't seem worth the trouble of filtering by lock mode here." --=20 With Regards, Amit Kapila.