| From: | Greg Nancarrow <gregn4422(at)gmail(dot)com> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| 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: | 2022-01-21 00:05:55 | 
| Message-ID: | CAJcOf-d0=vQx1Pzbf+LVarywejJFS5W+M6uR+2d0oeEJ2VQ+Ew@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Tue, Dec 21, 2021 at 12:55 PM Greg Nancarrow <gregn4422(at)gmail(dot)com> wrote:
>
> On Tue, Dec 21, 2021 at 11:56 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > 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.
> >
>
> Oops, yeah, I got carried away; if palloc() failed and called exit(),
> then it would end up crashing when trying to use/pfree rd_pubactions
> again.
> Better leave that line in ...
>
Attaching an updated patch to fix that oversight.
This patch thus fixes the original palloc issue in a minimal way,
keeping the same relcache structure.
Regards,
Greg Nancarrow
Fujitsu Australia
| Attachment | Content-Type | Size | 
|---|---|---|
| v2_get_rel_pubactions_improvement.patch | application/octet-stream | 3.9 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2022-01-21 00:06:37 | Re: PoC: using sampling to estimate joins / complex conditions | 
| Previous Message | Peter Geoghegan | 2022-01-20 23:54:23 | Re: autovacuum prioritization |