Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE
Date
Msg-id aesL5f+z2K3ZPI/H@bdtpg
Whole thread
In response to Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE  (shveta malik <shveta.malik@gmail.com>)
Responses Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE
List 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.malik@gmail.com> wrote:
> >
> > On Thu, Apr 23, 2026 at 1:01 AM Bharath Rupireddy
> > <bharath.rupireddyforpostgres@gmail.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



pgsql-hackers by date:

Previous
From: Lukas Fittl
Date:
Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?
Next
From: Peter Eisentraut
Date:
Subject: Re: Bug: Missing check_stack_depth() in GRAPH_TABLE rewriter