From: | Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com> |
---|---|
To: | tushar <tushar(dot)ahuja(at)enterprisedb(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_dump ignoring information_schema tables which used in Create Publication. |
Date: | 2017-05-22 11:42:24 |
Message-ID: | CAGz5QCJr8Gc9vTbNDLms+PuUp6bc9z2=iK7bP2Jfyv7-pirJtw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)ahuja(at)enterprisedb(dot)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(at)centos-cpula regress]$ pg_dump -Fp test > /tmp/a.a
> [centos(at)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(at)centos-cpula regress]$
>
> --
> regards,tushar
> EnterpriseDB https://www.enterprisedb.com/
> The Enterprise PostgreSQL Company
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | tushar | 2017-05-22 11:52:56 | Re: pg_dump ignoring information_schema tables which used in Create Publication. |
Previous Message | Albe Laurenz | 2017-05-22 11:05:14 | Index created in BEFORE trigger not updated during INSERT |