Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE
Date: 2026-04-24 06:21:25
Message-ID: aesL5f+z2K3ZPI/H@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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).

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-04-24 06:24:13 Re: Bug: Missing check_stack_depth() in GRAPH_TABLE rewriter
Previous Message Lukas Fittl 2026-04-24 06:16:07 Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?