Re: [HACKERS] pg_dump ignoring information_schema tables which usedin Create Publication. - Mailing list pgsql-hackers

From Kuntal Ghosh
Subject Re: [HACKERS] pg_dump ignoring information_schema tables which usedin Create Publication.
Date
Msg-id CAGz5QCJr8Gc9vTbNDLms+PuUp6bc9z2=iK7bP2Jfyv7-pirJtw@mail.gmail.com
Whole thread Raw
In response to [HACKERS] pg_dump ignoring information_schema tables which used in CreatePublication.  (tushar <tushar.ahuja@enterprisedb.com>)
Responses Re: [HACKERS] pg_dump ignoring information_schema tables which usedin Create Publication.  (tushar <tushar.ahuja@enterprisedb.com>)
Re: [HACKERS] pg_dump ignoring information_schema tables which usedin Create Publication.  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Hello,

pg_dump ignores anything created under object name "pg_*" or
"information_schema". I guess you will not have any "CREATE TABLE"
definition  as well for information_schema.abc. Related code:

else if (strncmp(nsinfo->dobj.name, "pg_", 3) == 0 ||            strcmp(nsinfo->dobj.name, "information_schema") == 0)
{       /* Other system schemas don't get dumped */       nsinfo->dobj.dump_contains = nsinfo->dobj.dump =
DUMP_COMPONENT_NONE;  }
 

Hence, there is no point of creating publication for it in the dump.

On Mon, May 22, 2017 at 4:22 PM, tushar <tushar.ahuja@enterprisedb.com> wrote:
> Hi,
>
> pg_dump is ignoring tables which created under information_schema schema
> for  CREATE PUBLICATION .
>
> postgres=# create database  test;
> CREATE DATABASE
> postgres=# \c test
> You are now connected to database "test" as user "centos".
> test=# create table information_schema.abc(n int);
> CREATE TABLE
> test=# create publication test for table information_schema.abc;
> CREATE PUBLICATION
> test=# select * from pg_publication_tables;
>  pubname |     schemaname     | tablename
> ---------+--------------------+-----------
>  test    | information_schema | abc
> (1 row)
>
> test=# \q
> [centos@centos-cpula regress]$ pg_dump -Fp  test > /tmp/a.a
> [centos@centos-cpula regress]$ cat /tmp/a.a|grep publication -i
> -- Name: test; Type: PUBLICATION; Schema: -; Owner: centos
> CREATE PUBLICATION test WITH (publish = 'insert, update, delete');
> ALTER PUBLICATION test OWNER TO centos;
> [centos@centos-cpula regress]$
>
> --
> regards,tushar
> EnterpriseDB  https://www.enterprisedb.com/
> The Enterprise PostgreSQL Company
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers



-- 
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Albe Laurenz
Date:
Subject: [HACKERS] Index created in BEFORE trigger not updated during INSERT
Next
From: tushar
Date:
Subject: Re: [HACKERS] pg_dump ignoring information_schema tables which usedin Create Publication.