From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Greg Nancarrow <gregn4422(at)gmail(dot)com> |
Cc: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: PublicationActions - use bit flags. |
Date: | 2021-12-21 00:56:26 |
Message-ID: | 2683410.1640048186@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Greg Nancarrow <gregn4422(at)gmail(dot)com> writes:
> I've attached a patch which addresses that and replaces a couple of
> memcpy()s with struct assignment, as suggested.
Removing this is not good:
if (relation->rd_pubactions)
- {
pfree(relation->rd_pubactions);
- relation->rd_pubactions = NULL;
- }
If the subsequent palloc fails, you've created a problem where
there was none before.
I do wonder why we have to palloc a constant-size substructure in
the first place, especially one that is likely smaller than the
pointer that points to it. Maybe the struct definition should be
moved so that we can just declare it in-line in the relcache entry?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-12-21 01:01:59 | Re: sequences vs. synchronous replication |
Previous Message | Ajin Cherian | 2021-12-21 00:54:00 | Re: row filtering for logical replication |