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 1vkwwC-004w56-2Q for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 04:13:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkwwB-00HHGW-2f for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 04:13:52 +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 1vkwwB-00HHGH-1H for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 04:13:51 +0000 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vkww8-002fwJ-2h for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 04:13:50 +0000 Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-894770e34afso105343296d6.0 for ; Tue, 27 Jan 2026 20:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769573629; cv=none; d=google.com; s=arc-20240605; b=CYEMRBRAr2oZGBG3xrrku5ixj9hqswwV+ckqOHLBf5lB8wPH/GJvnB2WadSUxjKHKy D3d6GL9N7fr1odNbfDQ0HlyudIyV7xLcWuYDz9wrFc8pajECSW2gRp6OIrR9OACwJ7ci FQIeBm1hOc5AP91aBk+iXP9Qh8riXKI+018FwW6glaW8bjnEG+8/eZIHI4tyEv2EZ6nG /t55ADiwxExBmdKDBouYvAy2yAgZq2qfIK0EMSqjVO8wGe/UkWMjUhu5CrBkP7ELfZw0 oZubhBN7SehO3vdlFlTsnNKVWHwPz9mAyjM/iZSxT+V1pzGMibNKhGBnboiP66Uyl5RJ CgYg== 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:in-reply-to:references :mime-version:dkim-signature; bh=3oBjRJN7v+2sYNWe9etUymsWCO3fcdCChK5pEy242Ho=; fh=URzeHyT5SqSzLop28rl5e9jCzJnfEVXtw+BhLk30a7E=; b=bR+KMF6U9WJetnhPa2fH0OSN+Qi+vCacpTjOEo3qrIYLvx8n0+2wlRCBIP8Iu+bkBQ mN481mLENZ0hWGCFAfJkLx6/WyB+saDcnyDh/jP4ecxAtS+y8UpXHQKVFb89ozFjEIMK JhtEEerjHi3EHsaefGTKp5K1brtQL3lFV8BN3+3NUrGaMqBegBqA90t8DoXGSrJ6rVKM lMIkf0VylR9C1f74+DZjh2Ew/llD33JtAG8YcyiNcpZq8sP1E+IDXJqZU/4TARhnaigw mUkBdxI2YJwu4LVKLmV4cfNpQoWajHUI7zwIvBTXsVUSgyv2qum77Dvl1xrd4sMCXXS0 GbgA==; 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=20230601; t=1769573629; x=1770178429; 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=3oBjRJN7v+2sYNWe9etUymsWCO3fcdCChK5pEy242Ho=; b=NG1vGxTJTpDBSKn/xXR2Axh1NsOFH1usO/mB5cggMt7+oI3vW3p+gfFCXnMQifFezq N0El1xIGGTANwS7RQ+zbPaZ05hk+javtZ5aEsk/qnQXacjsdBi7vRAwlrSCXg7sg/EJL YdDF0ZZJJkX7vYTGB7BIplCxmx8uMdY9pmtqVx5GuOWFznaWaXYmXfF97xY/DGkBgX6K F/CifNUwCEIWUYwM28yZRkliHDENMpQ+goOp/TsimXT6BI5c8/kIKo68jkjQtnMT3qu9 hS/8XyX1EBfqUc/u4BHzz/u0khpuMW5dRNT21EW+9QCogSG0H3YF/83gEAnmEc8viU2W ZZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769573629; x=1770178429; h=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=3oBjRJN7v+2sYNWe9etUymsWCO3fcdCChK5pEy242Ho=; b=HRWaVW6UFjIpsVv2JL7mGOlcldy3fh8d/k73OIn5X6Nm+I13Gx3GaXZT/mNdDOQYM5 sNUk0kLc3I9jRMhdVHv5HhhcGF/mJWq96OZTR5K7+KiFOCazaVAygBekfSJDxet0xAU+ IEwPC5hve5f9nYCJN8XBcnyvCiFrBZULQtdqZJ7wHScmnGb25NGt1nnnCnFjkDpFsIrM e6nyDDeGbka/+7LeqXFrtLnys3Fp0FiiFmK1T9vQQb1ykTrUUlqNL2bfLO9v1qMFVWxZ TSQGPHPbfWN6lPq26VtAPGQSdx2YzvVfvgbqrsGnaZfTbnSHPoLvZCwXhPhKwWXCp8oG P5Jw== X-Forwarded-Encrypted: i=1; AJvYcCXx4Vn6hSEyzIvMs3Vfr99QST6z0MQe+ss6Prpi4jTFJ/ER3z8SoRZqKQFfndUhRWssHMD8oA7DCjwf5n3o@lists.postgresql.org X-Gm-Message-State: AOJu0YwmxDBb+fHEELTBjLTiUgbbo0jjkzR4vLnCFtRXKal7/a2usqEP rqUBJJzwXnv44YshVXW6f+h76/LVMsq+/0k9vtIUo9nE4OQ9xfQ9qu3o4fT9jZBxOx49qewh8e5 bZb5W1jK50gT0dQLeMWHtGkduRO9tkIM= X-Gm-Gg: AZuq6aLmLFLEbPujZU6v1lrqPRO0U5+sjh5KmH8Yydt7jkYwPO4vmo9DPW2PMXFBq8v aSxw5wdIHLyRz9jg8KoWNa7yJKShk+kik3TqDGW9hFvUg9PTnT3vJi943lIjxalf5Pz+JNYNfU0 pM0NziGRSih4lgmfVq2KiToiH150LXTq3utGe4q2DqCxuSX9stlekue73VfCMaARZ2cbfUXIzPI MkMrSbEEyYkkNIyeT5bdM6ANqw/scOg3jeTesRonCrWz2dNr4ZKAghnzXKIsjmzr/4AojqgxLog s+fQStI+C4JNXmRtJzjcP9G5ABxV2w== X-Received: by 2002:a05:622a:307:b0:4ff:c5f7:f812 with SMTP id d75a77b69052e-5032fa096c2mr54244081cf.38.1769573628538; Tue, 27 Jan 2026 20:13:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Wed, 28 Jan 2026 15:13:21 +1100 X-Gm-Features: AZwV_QgDqPhR4VeMjTNS2JXfkwSQrG7W_W6SrKORgDicYQJe7djm5fnKeFYU7j0 Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: Dilip Kumar Cc: vignesh C , Amit Kapila , shveta malik , Masahiko Sawada , Bharath Rupireddy , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Some review comments for the v25* patches: ////////// Patch v25-0001 ////////// 1. + /* + * Conflict log tables are managed by the system to record logical + * replication conflicts. We do not allow locking rows in CONFLICT + * relations. + */ + if (IsConflictNamespace(RelationGetNamespace(rel))) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("cannot lock rows in conflict log table \"%s\"", + RelationGetRelationName(rel)))); I felt the code comment should be changed, too. e.g. That comment sentence "We do not allow locking rows in CONFLICT relations" seemed redundant because you already said the CLT is "managed by the system", and also it is basically just repeating the same info as the error message. Suggest either: a) remove it, or b) change /CONFLICT/pg_conflict namespace/ ////////// Patch v25-0002 ////////// No review comments. ////////// Patch v25-0003 (docs) ////////// ====== doc/src/sgml/logical-replication.sgml (29.8 Conflicts) 1. There is an earlier sentence on this page: "Note that there are other conflict scenarios, such as exclusion constraint violations. Currently, we do not provide additional details for them in the log." ~ That "in the log part" wording maybe needs to be changed/removed now because the destination might be a CLT, not a log. SUGGESTION: Currently, we do not provide additional details for them. ~~~ 2. - The log format for logical replication conflicts is as follows: + The conflict_log_destination + parameter can automatically creates a dedicated conflict log table. This table is created in the dedicated + pg_conflict namespace. The name of the conflict log table + is pg_conflict_<subid>. The predefined schema of this table is + detailed in + . + + 2a. Typo: /can automatically creates/can automatically create/ ~ 2b. It sounds a bit strange to say "a dedicated" 2x in 2 sentences. Maybe omit the first one: SUGGESTION ... can automatically create a conflict log table. ~ 2c. Perhaps the "conflict log table" should be using SGML markup here. ~~~ 3. + + The conflicting row data, including the incoming remote row (remote_tuple) + and the associated local conflict details (local_conflicts), is stored in + JSON formats, for flexible querying and analysis. + /formats, for/format for/ ~~~ 4. + + If conflict_log_destination + is set to log conflicts to the server log, the following format is used: I'm not sure you need that link because the same parameter was already linked a bit earlier on this same page. ~~~ (29.9 Restrictions) 5. + + + Conflict log tables (see conflict_log_destination parameter) + are never published, even when using FOR ALL TABLES in a publication. + + That FOR ALL TABLES ought to have SGML markup. ====== doc/src/sgml/ref/create_subscription.sgml 6. I still feel that somewhere in here, there ought to be some link/s back to the "29.8 Conflicts" details about the CLT schema and LOG formats. SUGGESTION conflict_log_destination / log: ... See for the format used to log conflict details. conflict_log_destination / table: ... See for the predefined schema of the conflict log table. ====== Kind Regards, Peter Smith. Fujitsu Australia