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 1vl4HG-006Wps-0C for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 12:04:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vl4HC-0018fK-1y for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 12:04:02 +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 1vl4HC-0018fC-0R for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 12:04:02 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vl4HA-002jMW-01 for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 12:04:01 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-352c414bbbeso560002a91.0 for ; Wed, 28 Jan 2026 04:04:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769601840; cv=none; d=google.com; s=arc-20240605; b=HBVumg+GH8joImToYT5C9YFYlvKKsz5m7LCcbIbUh0A0DPSIyMO4HIcnEW4nJCIqpS E9Zzx+xt+aiwpSfF11OrgVCt9HAZLlqtF/89PIgMtkPYddae1o1mKSZpbY4lh74VXp/K vdQrlVCFS3UbgcsOEHjK71DhjhdH/lAGf1tJ34c9Qj2D197+npqSASYVA2enuEbuO9J/ Sd16PdCMiEdDWs+A6qmNTrd/h+G+UNusppBXolQoyLzSUS763M/rjA1/U6JUT7Xg8I1T ABGH4OqM8H4/dsx+kP/FgDKttHXL9erOB4lkzUOmkezUrlbbZiZQPDWNBgzUmtRixwPo eF2A== 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=3/fckpHWs1ZSmzmjygEAULIf1hLIdDFRUzGt2lpzAU0=; fh=vnIJkZ+62cnjyukmnWkZBXOGXoNO40Zr2mZ1QdUNIyI=; b=OgP/SZEKJ+GqwKFXd+rH/R+xQWA25Bpd+knWx5VlI+rCRqZ7p6OZb8fZIFdgvbhtaE 1wb0raplQXrUW5yBKKn7MSRfKRBVm9pNmGM9H61N3b34hWWbEq9vFVHzzwnGiJoxF//j tXh4rFDOYkH3gF1IPua/Rc17Y6H8xywVC98gxMfU2SVU3scCLOfW34Ahg1yNsShZYEQy Co48Z5qqcETbusE9ABLJ7YaIt8kdEmsVZQy2Ru2Mv78FNjD+DT8IqrYlsnJhCCsKRFhJ kUjB458PaQ1YknpHDqRSyQrxbLw/AviicM5wJMdkyeBn1mRLkHx8mTP/KbHz67dfm/XV qW8Q==; 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=1769601840; x=1770206640; 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=3/fckpHWs1ZSmzmjygEAULIf1hLIdDFRUzGt2lpzAU0=; b=fBBp6PYFUdiopnY1rY9E+dD4UfQSrsltbwK0ErcYFAfbM7gpvNYmQFXRwTqrYcURL0 wdIfxycPnOM4NzbKaMRV0Eg1+dZp657cfbzuiUo65at/fu5oj8Owi+IYvEnDmYnRTj3P jIymGyBJV8yfmDCpWEtqoRSW4m+3hAX39Bp8sPS4uS+Mhi3vYqA96w95p3ViiSuEEc0g 9+eL8BcqP2qc8VJacrd7JYaHXZ8GqUeV8Lp8FeIGWNJAZNp2j/cSeE8V9PQN7boTddt5 JmeJLt8HLwSNbA5lM99dcgNugFGYh68Gk0rMqagXQS77EbkoR3BNTkVb2upjcJN/fqvQ A4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769601840; x=1770206640; 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=3/fckpHWs1ZSmzmjygEAULIf1hLIdDFRUzGt2lpzAU0=; b=X57bgRmOQzUYDCxehqMq056jDb6iJ7NwpEOc7ZgqFpGMr011nhzpGUno3Co5WwsMWE tiLIVnJGtZKJ2/+xFCjPY02WbGmFyg7BLG/ZOX2A0LM8tu+iSvDK0UP5PbFFz/ATI1Fh xxGpMlY0ZP049/1gbc/uhvRSGCf9u0Ji3P2LbK9h0Wo1Po4JpI0AR0YYllSD0wzLSExz RQLuWtfU90aBj4+HDO70QxuZNzcRBEyHYwZaYSd+O/FWgxRqVz4ZlLW417TFpNvRvkAA 1XdH9tF6xar5sudS2VI8PMzuUoZqf/HcCGQR4LfcZYnqBGTqybXbENO/vutED6rnVpoE fenQ== X-Forwarded-Encrypted: i=1; AJvYcCXSCAlbN7Wz+XdCtRL9cEzIfn0rfmGceAofyOga3ktblvbIE9tTe/AR43heXCAj2nDQv9oGraiQspz+pR1s@lists.postgresql.org X-Gm-Message-State: AOJu0YyjO+DjBIMEbBYamV/giIQ5MlQugWcgZSXe+79jl0uYdUsh4n6V 1ci9YJducFdWuCnINa+/zQyrxZjgxG8wofJg6OANpop3KtJ1zzaFA/zPY4VbOP9RN8wyUSc9DLF ZUaH2BgK6reu8Dt8dIGORjTB5FuBcfzs= X-Gm-Gg: AZuq6aL/4E95gIOtBgjWP8kK//h6P92PrF6f3c/ELLshOwhnrMy82ZQoi/DChjpySlr 4IA0JudksMoSy6UgbisVe3bLXCrLRdlR/sKpwVXo4ocqIutmcrWqLR+eaekDUQOHggEQiSU7+db 1ATJWOqx8kX0rb1NV4uZJOJHBNdM7pOtQrGhWTCTaDN6wf+ToucV/sLXcYof+O5QkKxvQ3d9dC9 a8F6oNp5y2A2CwusTEhB89vidEzBOtG0A2Y9jcPIF3Ledy/HBkpc7WrIam+uhtQoKKqOR0K8j77 Ob0TJCxJO/ZiebpkQ68abID4nPNjYxtnf/AhxPs= X-Received: by 2002:a17:90b:2dcc:b0:352:ece8:1f6c with SMTP id 98e67ed59e1d1-353ff8f1955mr3839007a91.8.1769601839630; Wed, 28 Jan 2026 04:03:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Wed, 28 Jan 2026 17:33:48 +0530 X-Gm-Features: AZwV_QjmuFKys7WzBKwIbr8y-nuB7hq27GxnTQezr13YIR-N6yLdouoLWYuBmaM Message-ID: Subject: Re: Proposal: Conflict log history table for Logical Replication To: Dilip Kumar Cc: Peter Smith , vignesh C , Amit Kapila , 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 Tue, Jan 27, 2026 at 9:24=E2=80=AFAM Dilip Kumar = wrote: > > > Also fixed all pending doc comments. > Thanks for the patch, Please find a few comments: patch0001: 1) +/* + * GetLogDestination + * + * Convert string to enum by comparing against standardized labels. + */ +ConflictLogDest +GetLogDestination(const char *dest) IMO the name of the function should be GetConflictLogDest, otherwise the current name might suggest it applies to all the logs related to subscription, which is misleading. 2) + { .attname =3D "schemaname", .atttypid =3D TEXTOID }, I checked the catalog tables known to me which refer to namespace, all use namespace or nsp in their names, none use 'schema'. Examples: pg_namespace, pg_class, pg_type. pg_constraint. Shall we use nspname instead? ~~ patch0002: 1) conflict.c compiles without these: +#include "utils/fmgroids.h" +#include "utils/json.h" 2) + /* + * Get the conflict log destination. Also, (if there is one) return the + * CLT relation already opened and ready for insertion. + */ + conflictlogrel =3D GetConflictLogDestAndTable(&dest); 'CLT relation' means conflict log table relation. Shall we correct it to mention either table alone or relation alone? 3) This is defined in conflict.h: +/* The single source of truth for the conflict log table schema */ +static const ConflictLogColumnDef ConflictLogSchema[] =3D +{ .... + { .attname =3D "local_conflicts", .atttypid =3D JSONARRAYOID } +}; while its element 'local_conflicts' is defined in conflict.c: +/* Schema for the elements within the 'local_conflicts' JSON array */ +static const ConflictLogColumnDef LocalConflictSchema[] =3D +{ ... +}; It takes some time to figure this part out as a reader of code. I think we shall define LocalConflictSchema schema immediately after ConflictLogSchema for anyone to understand it better, unless there is something blocking it? 4) +# Verify that '2' is present inside the JSON structure using a regex +# This matches the key/value pattern for "a": 2 +like($raw_json, qr/\\"a\\":2/, 'Verified that key 2 exists in the local_conflicts'); + Reviewing further. Testing of 0002 yet to be finished. thanks Shveta