pgsql-hackers
❮
[PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION
- Jump to comment-1Lakshmi N<lakshmin.jhs@gmail.com>Apr 27, 2026, 5:33 AM UTCHi 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
The attached patch fixes this to use BoolGetDatum(), matching both theALTER SUBSCRIPTION path which correctly uses BoolGetDatum().
catalog definition and the ALTER path.
Regards,
Lakshmi- Jump to comment-1Nisha Moond<nisha.moond412@gmail.com>Apr 27, 2026, 8:29 AM UTCOn Mon, Apr 27, 2026 at 11:03 AM Lakshmi N <lakshmin.jhs@gmail.com> wrote:
+1
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.
This looks like an oversight in commit a850be2.
--
Thanks,
Nisha- Jump to comment-1Amit Kapila<amit.kapila16@gmail.com>Apr 28, 2026, 10:59 AM UTCOn Mon, Apr 27, 2026 at 1:59 PM Nisha Moond <nisha.moond412@gmail.com> wrote:
On Mon, Apr 27, 2026 at 11:03 AM Lakshmi N <lakshmin.jhs@gmail.com> wrote:
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.
Pushed.
+1
This looks like an oversight in commit a850be2.
--
With Regards,
Amit Kapila.