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>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Something is rotten in publication drop
Date: 2017-06-09 15:25:49
Message-ID: dfdf2a16-6328-14cc-7dc1-395798947749@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/8/17 23:53, Tom Lane wrote:
> --- 155,161 ----
>
> SET search_path = mvtest_mvschema, public;
> \d+ mvtest_tvm
> ! ERROR: publication "addr_pub" does not exist
> -- modify the underlying table data
> INSERT INTO mvtest_t VALUES (6, 'z', 13);
> -- confirm pre- and post-refresh contents of fairly simple materialized views
>
> This appears to have something to do with the concurrently-running
> object_address test script, which creates and then drops a publication
> named "addr_pub". However, there is no visible connection between
> mvtest_tvm (or any of the objects it depends on) and addr_pub or any
> of the objects it is told to publish. So what happened here, and
> isn't this a bug?

The \d+ command attempts to print out any publications that the relation
is part of. To find the publications it is part of, it runs this query:

"SELECT pub.pubname\n"
" FROM pg_catalog.pg_publication pub,\n"
" pg_catalog.pg_get_publication_tables(pub.pubname)\n"
"WHERE relid = '%s'\n"
"ORDER BY 1;",

pg_get_publication_tables() calls GetPublicationByName(), which throws
this error.

So I suppose that if a publication is dropped between the time
pg_publication is read and the function is called, you could get this error.

How could we improve that?

--
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 Peter Eisentraut 2017-06-09 15:29:11 Re: strcmp() tie-breaker for identical ICU-collated strings
Previous Message Jeff Janes 2017-06-09 15:24:52 partial aggregation with internal state type