[PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION - Mailing list pgsql-hackers

From Lakshmi N
Subject [PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION
Date
Msg-id CA+3i_M98-XjE-_fw0p+8xOnw64y2_YLtJfcwvCfsVMn-z2ZjGg@mail.gmail.com
Whole thread
Responses Re: [PATCH] Fix Int32GetDatum used for bool column in CREATE SUBSCRIPTION
List 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

pgsql-hackers by date:

Previous
From: Haibo Yan
Date:
Subject: Re: Extract numeric filed in JSONB more effectively
Next
From: Fujii Masao
Date:
Subject: Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks