PUBLICATIONS and pg_dump

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: PUBLICATIONS and pg_dump
Date: 2017-02-07 20:19:32
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers


* Peter Eisentraut (peter_e(at)gmx(dot)net) wrote:
> Logical replication
> - Add PUBLICATION catalogs and DDL
> - Add SUBSCRIPTION catalog and DDL
> - Define logical replication protocol and output plugin
> - Add logical replication workers

I think we need to have a bit more discussion regarding where
publications (and maybe subscriptions... not sure on that though) fit
when it comes to pg_dump.

In particular, I'm trying to clean up the pg_dump TAP tests and am
finding things I wouldn't have expected. For example, publications
appear to be included in pretty much every pg_dump output, no matter if
a specific schema or even table was explicitly called for, or if that
publication or subscription was explicitly associated with that table.

The example I'm playing with is:


and a simple:

pg_dump -n public -t t1

Will end up including the CREATE PUBLICATION command.

In fact, I'm not entirely sure how to have it not included in pg_dump's

I understand that this is a bit complicated, but I would have thought
we'd do something similar to what is done for DEFAULT PRIVILEGES, where
we include the "global" default privileges when we are doing a dump of
"everything", but if we're dumping a specific schema then we only
include the default privileges directly associated with that schema.

Perhaps we need to include publications which are specific to a
particular table, but the current logic of, essentially, "always include
all publications" does not seem to make a lot of sense to me.

I'm happy to be corrected if I've grossly misunderstood something here,
of course.



In response to


Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-02-07 21:02:21 pgsql: Allow the element allocator for a simplehash to be specified.
Previous Message Robert Haas 2017-02-07 20:13:52 pgsql: Fix compiler warning.

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2017-02-07 20:29:05 Re: GSoC 2017 - LAST CALL
Previous Message Robert Haas 2017-02-07 20:13:53 Re: Cache Hash Index meta page.