Re: Added schema level support for publication.

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>

From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: tanghy.fnst@fujitsu.com, Rahila Syed <rahilasyed90@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-11T13:13:44Z
Lists: pgsql-hackers
On Fri, Jun 11, 2021, 6:22 PM Bharath Rupireddy <
bharath.rupireddyforpostgres@gmail.com> wrote:

> On Sat, Jun 5, 2021 at 7:02 PM vignesh C <vignesh21@gmail.com> wrote:
> > Thanks for identifying and reporting this issue. I have \dn with the
> > equivalent query to display only the publication name. The updated
> > patch has the fix for the same.
>
> Currently, FOR ALL TABLES is there to add all the tables(existing and
> future) in the current database in which the publication is created. I
> wonder before providing FOR SCHEMA capability, we better target FOR
> DATABASE first, something like CREATE PUBLICATION ... FOR DATABASE
> foo, bar, baz, qux; Of course users with the proper permissions on the
> specified databases can add them to the publication. This can help to
> add all the tables in other databases as well. Then, the CREATE
> PUBLICATION ... FOR SCHEMA foo, bar, baz, qux; makes more sense.
> Because, my understanding is that: database is a collection of tables,
> schema is a collection of databases. I may be wrong here, but it's
> just a thought. What do you think?
>

Please ignore above comment. I was confused about what a database and
schema is in postgres. I'm sorry for the noise.

https://www.postgresql.org/docs/devel/ddl-schemas.html

Regards,
Bharath Rupireddy.

Commits

  1. Include schema/table publications even with exclude options in dump.

  2. Rename some enums to use TABLE instead of REL.

  3. Add tap tests for the schema publications.

  4. Allow publishing the tables of schema.

  5. In pg_dump, use simplehash.h to look up dumpable objects by OID.