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.98.2) (envelope-from ) id 1xTZOj-00000000PKZ-0GeL for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Nov 2026 06:44:01 +0000 Received: from localhost ([127.0.0.1]:33202 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xTZOi-00000009ZQa-0GV0 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Nov 2026 06:44:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:34124) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xTZOh-00000009ZQR-3ASu for pgsql-hackers@lists.postgresql.org; Wed, 18 Nov 2026 06:43:59 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xTZOY-00000000Gr6-0CHE for pgsql-hackers@postgresql.org; Wed, 18 Nov 2026 06:43:58 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-48e09aa5264so262503f8f.2 for ; Tue, 17 Nov 2026 22:43:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794984229; x=1795589029; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=FqfqBEbiqlPy5ruK29qCpzHc0aSAR3TrrdBRvd6F22Q=; b=npZxOK313PcCoCLl9TA2LyKng3XL2ZFsKX/Sk3XISV7Su30I4BdIeqAU4PZSrxIMJy nIcaHOTuQO8XjF8i8A5TL01a4R6RDqrvnrRURFQJiaaLKmOxh7o5+Wc/oBMSKQ4OXofI P5zDdTRg7/h2uKzGoKSA1B7yZ3HuRXZ09UhqPdhrFv+kmJYDV2JJy/jOmcF4ZtqDuzdz 77cvIALfAimH/KHXUpVZWbNTnVU16OobRNRQxV7i8oNfmzkVjgIXYI4l/2Ptx11GNrh1 9VdKQLMsROw7qc+/baTuU4fn7SuVLfjwQKr6uLaOcf7HqUdnhu4RT4so4WOFcl7PJPs3 W1+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794984229; x=1795589029; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=FqfqBEbiqlPy5ruK29qCpzHc0aSAR3TrrdBRvd6F22Q=; b=aREJF/j+vSN96HkHgkhZFpQMyTxNf7845IlA5zApPRSwCg1/0P8TRds1dUPpR4jq0U 9OAp4zjy0Tv5W3MGFnvmowoXHvBq2U9ndkEq8JiUGqrFTQ20rlj0QZndCSlNCOVPlp64 CRDVAKXzAM7J/b0EXYNYzmAbx5z0OExr12X5J7OEHFiQcKuuubnP3gYSOe11KcDn/Vnb 2TzMcVgcKe/SK2fQaVhQECWp/iVPaw3tRJs8ImfuOaI5H63Wqo38ICEsdRaF93sh26q/ mEf9Of4gRsTYpiirVnbHhorcKmaal4z0lQUcnYq/UhG/9mvANj5wu9NX8ptlxyMpBaMK ZNzQ== X-Forwarded-Encrypted: i=1; AL+hErE9vlB3K8bvJaLJMqmvK0Y6O3rukiWCDWQNnBSnf8Xtqd7P8OpSru6Y3x9KVk7rmi8e4+LhfTzJHYaosF8t@postgresql.org X-Gm-Message-State: APuU4Z8E54bUItJzwvCyWSCBBQRtfnnEzcrFzmhQti0hMbjyNXN3qO0f gMXtzge6wiYeTBGzfgxkhITTaf0lR7Lv0gowkpkB0vu4M53rrNdiFagB X-Gm-Gg: AZFdTZcABvBxrYQpAEDmkdZOc9njlbuOVkUFQbj9UlPfiGUlkltwm6yYN8Dg9o3QsJs vl7pb08QJ+SENk41aI8RVfLSG/qDIgflQu5n+VPi+4SPyhFEJShga5wWBUE8yMVjipX5VKozMOD OMoCD+l4WWRzGR0YuHGhuAImAtdcNKOat4WP59qt/qoOOUkmTDCOwgXhLaDtU1eB0mSA77oNtQD 9jDKLkoQJ5CN1Q3qlEXWWYejcjHvdUjY60M0VPA8eujxNx0iqKKdx4LD6QLp+eUe9S6HfUSsV1h 6V+0rslcKK+PQ79nlqYHH4uf01wFEF+rLKOXBGXJ+sg3DrZSnphjy5GLLYgSdk2HuFlTwd4Ln55 kcE1iDItA6XievDEyeqrTSscf5AAQIIEGBnczln4U8g0usDljg3+neMDfmy9VUbmdy9HybAVCb0 oAOXxPp7WaqLa/HeHBbzH9nywcp1MnV9drcz9rQP5lWcdOBsLnX7hbwsY9UcuswbP9koATyFOFq kTIZEC5AeBebuGVHSnIDkIQ1T9ZWFFig79b7+BHO2+h+T9WtuM6yJAvfGgdRfmu85bXGG35CgvH O55xVRBkGVlaT6/af1LqORYoQU2nJwMxGGG9pZ+qOpe4G3nVzQgh0Ts4VW6RLliNfMot5V6ECpT eMt+MfI+zi69hFHCQVJaIOSj1+FLlhadY7A== X-Received: by 2002:adf:e191:0:b0:4a4:f86e:d90 with SMTP id ffacd0b85a97d-4a63beaa18dmr2998253f8f.52.1794984228901; Tue, 17 Nov 2026 22:43:48 -0800 (PST) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4a65683d5a2sm2986350f8f.43.2026.11.17.22.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 22:43:48 -0800 (PST) Date: Wed, 18 Nov 2026 06:43:47 +0000 From: Bertrand Drouvot To: Masahiko Sawada Cc: Zhijie Hou , Amit Kapila , Bharath Rupireddy , Chao Li , Fujii Masao , PostgreSQL-development Subject: Re: Add a hook for handling logical decoding messages on subscribers. Message-ID: References: <4d9e1d2f-27a2-40ec-92c8-4b5740736cf8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Nov 17, 2026 at 02:14:15PM -0800, Masahiko Sawada wrote: > On Tue, Nov 17, 2026 at 12:14 AM Bertrand Drouvot > wrote: > > > > Hi, > > > > On Mon, Nov 16, 2026 at 11:05:00AM -0800, Masahiko Sawada wrote: > > > > > > I've attached the updated patches. > > > > Thanks! > > > > I did not look in details but I have a question. I'm wondering what would happen > > with an unpatched publisher when both messages and streaming are enabled. Suppose > > a message is emitted in a subtransaction that is later aborted. The publisher > > sends the top level XID with the message, whereas STREAM ABORT refers to the > > subtransaction XID. IIUC, the patched subscriber would therefore not discard that > > message. > > > > Should 0002 handle this case somehow? > > Good point. In that case, the subscriber would apply the message when > the top-level transaction commits, even though the subtransaction that > emitted it was rolled back. Yeah, thanks for confirming. > Given that the 0001 patch is not backpatched, I think the subscriber > should request the messages option only from v20 or later publishers, > like it doesn't send the origin option to publishers older than v16. > The patch already checks the publisher version there, so we just need > to raise it from v14 to v20. What do you think? One difference with origin is that older publishers do not support that option at all, whereas v14 through v19 publishers support messages and the issue occurs only when streaming is enabled. I wonder if it would make sense to request messages from those publishers when streaming is disabled, and require v20 or later when streaming is enabled? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com