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 1wUj9g-001Ogy-1h for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jun 2026 10:49:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wUj9f-00177O-1T for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jun 2026 10:48:59 +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 1wUj9f-00177G-08 for pgsql-hackers@lists.postgresql.org; Wed, 03 Jun 2026 10:48:59 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wUj9d-00000000tgo-1toT for pgsql-hackers@lists.postgresql.org; Wed, 03 Jun 2026 10:48:58 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-396753f343aso39294631fa.2 for ; Wed, 03 Jun 2026 03:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780483734; cv=none; d=google.com; s=arc-20240605; b=D2rYIiV9FG3vWj6n9fChJ+3nUOYwHpkenXiox0YDzNoL8l8CJXv1rUv/S90sUHAcpd 6V0An5spyEo0mpmmtae5joiMV14NGUFbfeVQReShEPooSVya88PmUwn5mRVTRYtFVNqy wkGEem2OXUvYTmO3cKTvj4f352Zq7NphYEctuz+Bpx6gFtf2dBRpWA105/W3FaMXjgo0 9LO5rj5B2gCsHHf2yHZVaFW0dMPBlFzFQEhEkHH+Riyn8r6zsbWKW9O7WfvETFf0tikM +QengDxD5mh5r2NFQvu7LmAG1F6sEjRohXv27Cbd3YAKNSejZrUdWH5p8P3nZJk1e7Qy cAPQ== 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=Z1FX/B0AHtgh86vBKuLMdrnwPg5IB6/JZHJRAuI6Dp8=; fh=K74XJEFEVxclVWYMKPgOP2MAP6EZcvq4JyfFqhk+VMY=; b=FU5YKY1Hlp1hsZug6QOivqLruLdcE0Y7pO0v6HcAD0FO2/K8/FVZxUujkPn4PsS9sU Cv8zj/oqlhONsgUwY8INujtLCIRoV+/kQk9F57S2sqDX0vW9SdjvzywQ6tkDmR7zxp2p duPndG4ZHXwRXRWTAeCp3HZJkm8QfNeNxACQmTtrAEAlPymi4pINdb4wZneHzfn0B/Vu VARtxB9i8rPmLtA677wuE+/gQ5dMoIV7JnmaHEV5NJjea7T+2wte8IHCuWoaxHlsgzfe TZPPg54snvHQqYfozb8DHUu1NfYFNxCyiBsfo9Z+t/O46jUs12tci0+2k0swYcOMG7k8 Mgng==; 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=1780483734; x=1781088534; 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=Z1FX/B0AHtgh86vBKuLMdrnwPg5IB6/JZHJRAuI6Dp8=; b=EQEjL0kOk9TVz88JLDSKdztUatYWfaltupAYEF8qmrUSn/1KSiwWTwICz7CvPjqlpA x0cIAl+22d0A4Ry+HBMw8Tz36X7EYMRtz0uUfRm+0654udgKVgOlBPLKX84BVHfjmK+M KwnE74jrdgtJyEHGAC0PrzpwweT/R0EE1J2GeKGxuoFiz8GJichfwGrnHw02s+XYT16l 3j4UmMU4SmAd44Z8PGSWqbkWfdEmc7kPtcKTaxaBykfKgT4OkSNsgP9qQrp0lFRIAOQi As2WdS63K1GXmelRguhNmwT1iN5SSVgc2qONcL+Gfn6NHi3HADBCZZq2ohyTVhw3f636 ZegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780483734; x=1781088534; 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=Z1FX/B0AHtgh86vBKuLMdrnwPg5IB6/JZHJRAuI6Dp8=; b=RkAdTGuiUM+65Uq6EdM51iCXzFI86GDfrUMqpMf4a0dR6LzuWSV8gG0uE3L5baNgkn GULMvtXSexbBJQJ6Ih59lprEmlD4QPMLn5JhRWXR9KIgtInO7b1pqTQ0U7Idw+zGksJO KhqKS71yJs7LNDjHK/DtCZRsNU6ab9gd4Cu6kbCfD+4dH1aAWT8RmsWfvcawIpgB9tcp cdW17H7e+s77a/GO2Ph2gPa96lTfMItaY1tEfsyAmpeMTO5llqrSok/oR23kZk29cKPr 2rWcFN71nljlU4HMYkzYuVcGrn9EZml/PS/B1U2aCP3Hl1IXAY17bAHwK8OirD6w52CL etOQ== X-Forwarded-Encrypted: i=1; AFNElJ8tGEAJvEIenfBWqmp1RbNauHvlyqwVc7bX1gT1FzVGrP5DWxkSDa3xK022B6AN/sHR3LZJruw2m/w36Ga7@lists.postgresql.org X-Gm-Message-State: AOJu0Yx5Oud37fDXPUuM5sUocNqu7RXODGqKMflchjfWdTlftnPuUjPZ bWQX6dPAPJxYG+epzrUxGofpg/NSmxjJ4bcBdQC6tvyyjYLoJWxyIrM+K3/tuFhhsvNo1SUCFhu Ho9CGSWGe3FYuyiF2zJ+qBcsouu2+MA== X-Gm-Gg: Acq92OGuw1ZfX27Bpzpdu+4HxRSAllhNQVpoHRkAweTIRMdvI2Sb8qoA+4DfnR5X1g5 12jHi6phpWuedz6OC9wxgKFZ6Gsg0d4fJvuNbK28/VesvAEBSUK7Tiih7/fuuqVv19vwTcWjJQs +aON+QLBjDFnLbVW0G8F57fGqRUvPYP4HFTC7jW09hio/iV23dflimaYtAcM4+XlaCu53oiW28/ LRPbWdLFDA6vMjdsXM884u3SX9pueY1NOWRrpnYYVhehKsZ/7bcNLCmcfwNe+glrY0k7nScyvM0 SROmHqijk0V5LjJo95CEKY7L X-Received: by 2002:a2e:ad10:0:b0:396:8f6c:770d with SMTP id 38308e7fff4ca-396af14860fmr9566571fa.4.1780483734180; Wed, 03 Jun 2026 03:48:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nisha Moond Date: Wed, 3 Jun 2026 16:18:42 +0530 X-Gm-Features: AVHnY4I8GPdsxo7PpJWTQGk_8y7Q64f4pqEFhumAbJnLEhMs9Gns1LfCacOHnyA Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: vignesh C Cc: Dilip Kumar , Amit Kapila , Peter Smith , shveta malik , Masahiko Sawada , Bharath Rupireddy , PostgreSQL Hackers , shveta malik 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 Wed, Jun 3, 2026 at 3:24=E2=80=AFPM Nisha Moond wrote: > > Thanks for the updated patches, please find my comments on the v44 > patches below. These appear to apply to v45-001 and v45-002 as well, > as both are unchanged. > Here are couple more issues found during tests: 5) remote_commit_ts is available when streaming=3Don, in that case, we are not updating it and hence see NULL in the CLT. A simple test case: -- publisher ALTER SYSTEM SET logical_decoding_work_mem =3D '64kB'; SELECT pg_reload_conf(); CREATE TABLE t (a int PRIMARY KEY); CREATE PUBLICATION pub FOR TABLE t; -- subscriber (pre-insert the conflicting row, so copy_data=3Dfalse) CREATE TABLE t (a int PRIMARY KEY); INSERT INTO t VALUES (1); CREATE SUBSCRIPTION sub CONNECTION 'host=3Dlocalhost port=3D9933 dbname=3Dpostgres' PUBLICATION pub WITH (conflict_log_destination =3D 'all', streaming =3D on, copy_data =3D false); Trigger a streaming conflict -- publisher BEGIN; INSERT INTO t SELECT generate_series(2, 50000); INSERT INTO t VALUES (1); -- conflicts with subscriber's existing = row COMMIT; Check the CLT - remote_commit_ts is NULL despite timestamp being known -- subscriber SELECT conflict_type, remote_commit_ts, remote_commit_lsn FROM pg_conflict.pg_conflict_log_; conflict_type | remote_commit_ts | remote_commit_lsn ----------------+------------------+------------------- insert_exists | | 0/1234ABC I think we need to update it in apply_handle_stream_commit() -> case TRANS_LEADER_APPLY: remote_commit_ts =3D commit_data.committime; ~~~ 6) Different ERRORs for superuser vs non-superuser I created a subscription owned by a non-superuser (nisha), and the CLT for it is: postgres=3D# \d List of relations Schema | Name | Type | Owner -------------+-----------------------+-------+--------- pg_conflict | pg_conflict_log_16469 | table | nisha Now if I try to UPDATE the CLT as a superuser: postgres=3D# update pg_conflict_log_16469 set conflict_type=3D 'INSERT_EXIST' where conflict_type=3D'insert_exists'; ERROR: cannot modify or insert data into conflict log table "pg_conflict_log_16469" DETAIL: Conflict log tables are system-managed and only support cleanup via DELETE or TRUNCATE. However, running the same command as nisha (the sub/clt owner) results in: postgres=3D# SET SESSION AUTHORIZATION nisha; SET postgres=3D> update pg_conflict_log_16469 set conflict_type=3D 'INSERT_EXIST' where conflict_type=3D'insert_exists'; ERROR: permission denied for table pg_conflict_log_16469 I think the error should be consistent with the superuser case, rather than failing with a generic permission error. -- Thanks, Nisha