Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE
Date: 2026-04-24 07:17:03
Message-ID: CAJpy0uCmcoV=9OpsRkMLpX+R1kFra266MD+dLky7nx8gCm38Fw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 24, 2026 at 11:51 AM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Fri, Apr 24, 2026 at 11:19:40AM +0530, shveta malik wrote:
> > On Thu, Apr 23, 2026 at 4:45 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> > >
> > > On Thu, Apr 23, 2026 at 1:01 AM Bharath Rupireddy
> > > <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > > >
> > I tried to find if any other code-part does that, found one refernce
> > in hstore_svals():
> >
> > /* ugly ugly ugly. why no macro for this? */
> > (funcctx)->call_cntr++;
> >
> > Having said that, I could not find any other way to implement the fix
> > also.
>
> What about introducing a publication_tables_state struct stored in user_fctx
> that carries both the list and a private position index? (kind of what
> pg_timezone_abbrevs_zone() is doing).
>

Yeah, that is a good idea. Seems doable.

thanks
Shveta

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-04-24 07:18:12 Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
Previous Message Peter Smith 2026-04-24 06:59:42 Re: StringInfo fixes, v19 edition. Plus a few oddities