public inbox for [email protected]
help / color / mirror / Atom feedFrom: Lakshmi N <[email protected]>
To: [email protected] <[email protected]>
Subject: [PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION
Date: Sun, 26 Apr 2026 22:33:00 -0700
Message-ID: <CA+3i_M98-XjE-_fw0p+8xOnw64y2_YLtJfcwvCfsVMn-z2ZjGg@mail.gmail.com> (raw)
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
Attachments:
[application/octet-stream] subretentionactive-int32-to-bool.patch (689B, 3-subretentionactive-int32-to-bool.patch)
download | inline diff:
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index d512e87c..1e10d9d9 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -796,7 +796,7 @@ CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt,
values[Anum_pg_subscription_submaxretention - 1] =
Int32GetDatum(opts.maxretention);
values[Anum_pg_subscription_subretentionactive - 1] =
- Int32GetDatum(opts.retaindeadtuples);
+ BoolGetDatum(opts.retaindeadtuples);
values[Anum_pg_subscription_subserver - 1] = ObjectIdGetDatum(serverid);
if (!OidIsValid(serverid))
values[Anum_pg_subscription_subconninfo - 1] =
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: [PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION
In-Reply-To: <CA+3i_M98-XjE-_fw0p+8xOnw64y2_YLtJfcwvCfsVMn-z2ZjGg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox