Re: Something is rotten in publication drop

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Something is rotten in publication drop
Date: 2017-06-15 16:12:24
Message-ID: 15acce4f-4b10-18de-81a8-5f5cf42215e3@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/9/17 11:45, Tom Lane wrote:
> What we've done in many comparable situations is to allow a
> catalog-probing function to return NULL instead of failing
> when handed an OID or other identifier that it can't locate.
> Here it seems like pg_get_publication_tables() needs to use
> missing_ok = TRUE and then return zero rows for a null result.

Why is it that dropping a publication in another session makes our local
view of things change in middle of a single SQL statement? Is there
something we can change to address that?

> BTW, isn't the above command a hugely inefficient way of finding
> the publications for the target rel? Unless you've got a rather
> small number of rather restricted publications, seems like it's
> going to take a long time. Maybe we don't care too much about
> manual invocations of \d+, but I bet somebody will carp if there's
> not a better way to find this out. Maybe a better answer is to
> define a more suitable function pg_publications_for_table(relid)
> and let it have the no-error-for-bad-OID behavior.

That would possibly be better (the current function was written for a
different use case), but it could have the same concurrency problem as
above.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yuan Dong 2017-06-15 16:19:09 GiST API Adancement
Previous Message Peter Eisentraut 2017-06-15 16:06:49 Re: WIP: Data at rest encryption