public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: Tomas Vondra <[email protected]>
Cc: Rahila Syed <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Column Filtering in Logical Replication
Date: Thu, 16 Dec 2021 17:10:58 -0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2021-Dec-14, Tomas Vondra wrote:
> 7) There's a couple places doing this
>
> if (att_map != NULL &&
> !bms_is_member(att->attnum - FirstLowInvalidHeapAttributeNumber,
> att_map) &&
> !bms_is_member(att->attnum - FirstLowInvalidHeapAttributeNumber,
> idattrs) &&
> !replidentfull)
>
> which is really hard to understand (even if we get rid of the offset), so
> maybe let's move that to a function with sensible name. Also, some places
> don't check indattrs - seems a bit suspicious.
It is indeed pretty hard to read ... but I think this is completely
unnecessary. Any column that is part of the identity should have been
included in the column filter, so there is no need to check for the
identity attributes separately. Testing just for the columns in the
filter ought to be sufficient; and the cases "if att_map NULL" and "is
replica identity FULL" are also equivalent, because in the case of FULL,
you're disallowed from setting a column list. So this whole thing can
be reduced to just this:
if (att_map != NULL && !bms_is_member(att->attnum, att_map))
continue; /* that is, don't send this attribute */
so I don't think this merits a separate function.
[ says he, after already trying to write said function ]
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Before you were born your parents weren't as boring as they are now. They
got that way paying your bills, cleaning up your room and listening to you
tell them how idealistic you are." -- Charles J. Sykes' advice to teenagers
view thread (167+ 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], [email protected], [email protected], [email protected]
Subject: Re: Column Filtering in Logical Replication
In-Reply-To: <[email protected]>
* 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