[PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION

From: Lakshmi N <lakshmin(dot)jhs(at)gmail(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION
Date: 2026-04-27 05:33:00
Message-ID: CA+3i_M98-XjE-_fw0p+8xOnw64y2_YLtJfcwvCfsVMn-z2ZjGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

In CreateSubscription(), the subretentionactive catalog column (declared as
bool in pg_subscription.h) is populated using Int32GetDatum() instead of
BoolGetDatum():

This writes 4 bytes into a 1-byte bool Datum. It is inconsistent with the
ALTER SUBSCRIPTION path which correctly uses BoolGetDatum().

The attached patch fixes this to use BoolGetDatum(), matching both the
catalog definition and the ALTER path.

Regards,
Lakshmi

Attachment Content-Type Size
subretentionactive-int32-to-bool.patch application/octet-stream 689 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-04-27 05:36:11 Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks
Previous Message Haibo Yan 2026-04-27 05:01:58 Re: Extract numeric filed in JSONB more effectively