Re: [HACKERS] Logical replication and inheritance

2017-04-20 Thread Amit Langote
On 2017/04/21 3:22, Peter Eisentraut wrote: > On 4/18/17 01:58, Amit Langote wrote: >> We could be more explicit here and say the following instead: >> >> create publication mypub for table p; >> ERROR: "p" is a partitioned table >> DETAIL: Adding partitioned tables to publications is not

Re: [HACKERS] Logical replication and inheritance

2017-04-20 Thread Peter Eisentraut
On 4/18/17 01:58, Amit Langote wrote: > We could be more explicit here and say the following instead: > > create publication mypub for table p; > ERROR: "p" is a partitioned table > DETAIL: Adding partitioned tables to publications is not supported. > > Thoughts? (a patch is attached for

Re: [HACKERS] Logical replication and inheritance

2017-04-17 Thread Amit Langote
On 2017/04/14 21:44, Petr Jelinek wrote: > On 14/04/17 06:14, Amit Langote wrote: >> On 2017/04/14 10:57, Petr Jelinek wrote: >>> For me the current behavior with inherited tables is correct. >> >> By the way, what do you think about the pg_dump example/issue I mentioned? >> Is that a pg_dump

Re: [HACKERS] Logical replication and inheritance

2017-04-17 Thread Amit Langote
On 2017/04/17 23:08, Peter Eisentraut wrote: > On 4/16/17 23:00, Amit Langote wrote: >>> To fix this, pg_dump should emit ADD TABLE ONLY foo. >> >> Yeah, that's one way. Attached is a tiny patch for that. >> >> By the way, I noticed that although grammar accepts ONLY and * against a >> table name

Re: [HACKERS] Logical replication and inheritance

2017-04-17 Thread Peter Eisentraut
On 4/16/17 23:00, Amit Langote wrote: >> To fix this, pg_dump should emit ADD TABLE ONLY foo. > > Yeah, that's one way. Attached is a tiny patch for that. > > By the way, I noticed that although grammar accepts ONLY and * against a > table name to affect whether descendant tables are included,

Re: [HACKERS] Logical replication and inheritance

2017-04-16 Thread Amit Langote
On 2017/04/15 3:53, Peter Eisentraut wrote: > On 4/13/17 06:48, Amit Langote wrote: >> That is an important consideration because of pg_dump. See below: >> >> create table foo (a int); >> create table bar () inherits (foo); >> create publication mypub for table foo; -- bar is added too. >> >> $

Re: [HACKERS] Logical replication and inheritance

2017-04-14 Thread Peter Eisentraut
On 4/13/17 01:00, Noah Misch wrote: >> Relative to some of the other open items I'm involved in, I consider >> this a low priority, so I'm not working on it right now. > > By what day should the community look for your next update? Tuesday -- Peter Eisentraut

Re: [HACKERS] Logical replication and inheritance

2017-04-14 Thread Peter Eisentraut
On 4/13/17 06:48, Amit Langote wrote: > That is an important consideration because of pg_dump. See below: > > create table foo (a int); > create table bar () inherits (foo); > create publication mypub for table foo; -- bar is added too. > > $ pg_dump -s | psql -e test > > ALTER PUBLICATION

Re: [HACKERS] Logical replication and inheritance

2017-04-14 Thread Petr Jelinek
On 14/04/17 06:14, Amit Langote wrote: > On 2017/04/14 10:57, Petr Jelinek wrote: >> I don't think inheritance and partitioning should behave the same in >> terms of logical replication. > > I see. > >> >> For me the current behavior with inherited tables is correct. > > OK. > > By the way,

Re: [HACKERS] Logical replication and inheritance

2017-04-13 Thread Amit Langote
On 2017/04/14 10:57, Petr Jelinek wrote: > I don't think inheritance and partitioning should behave the same in > terms of logical replication. I see. > > For me the current behavior with inherited tables is correct. OK. By the way, what do you think about the pg_dump example/issue I

Re: [HACKERS] Logical replication and inheritance

2017-04-13 Thread Petr Jelinek
I don't think inheritance and partitioning should behave the same in terms of logical replication. For me the current behavior with inherited tables is correct. What I would like partitioned tables support to look like is that if we add partitioned table, the data decoded from any of the

Re: [HACKERS] Logical replication and inheritance

2017-04-13 Thread Amit Langote
On 2017/04/13 0:10, Robert Haas wrote: > On Wed, Apr 5, 2017 at 8:25 AM, Peter Eisentraut > wrote: >> After thinking about it some more, I think the behavior we want would be >> that changes to inheritance would reflect in the publication membership. >> So if

Re: [HACKERS] Logical replication and inheritance

2017-04-12 Thread Noah Misch
On Wed, Apr 12, 2017 at 11:02:44AM -0400, Peter Eisentraut wrote: > On 4/9/17 22:16, Noah Misch wrote: > > On Wed, Apr 05, 2017 at 08:25:56AM -0400, Peter Eisentraut wrote: > >> After thinking about it some more, I think the behavior we want would be > >> that changes to inheritance would reflect

Re: [HACKERS] Logical replication and inheritance

2017-04-12 Thread Robert Haas
On Wed, Apr 5, 2017 at 8:25 AM, Peter Eisentraut wrote: > After thinking about it some more, I think the behavior we want would be > that changes to inheritance would reflect in the publication membership. > So if you have a partitioned table, adding more

Re: [HACKERS] Logical replication and inheritance

2017-04-12 Thread Peter Eisentraut
On 4/9/17 22:16, Noah Misch wrote: > On Wed, Apr 05, 2017 at 08:25:56AM -0400, Peter Eisentraut wrote: >> After thinking about it some more, I think the behavior we want would be >> that changes to inheritance would reflect in the publication membership. >> So if you have a partitioned table,

Re: [HACKERS] Logical replication and inheritance

2017-04-09 Thread Noah Misch
On Wed, Apr 05, 2017 at 08:25:56AM -0400, Peter Eisentraut wrote: > After thinking about it some more, I think the behavior we want would be > that changes to inheritance would reflect in the publication membership. > So if you have a partitioned table, adding more partitions over time > would

Re: [HACKERS] Logical replication and inheritance

2017-04-05 Thread Peter Eisentraut
After thinking about it some more, I think the behavior we want would be that changes to inheritance would reflect in the publication membership. So if you have a partitioned table, adding more partitions over time would automatically add them to the publication. We could implement this either

Re: [HACKERS] Logical replication and inheritance

2017-03-06 Thread Amit Langote
On 2017/03/06 18:04, Amit Langote wrote: > One more option is for OpenTableList() called by CreatePublication() and > AlterPublicationTables() to not disregard inheritance, as if ONLY was > specified. Oops, meant to say: One more option is for OpenTableList to disregard inheritance... Thanks,

Re: [HACKERS] Logical replication and inheritance

2017-03-06 Thread Amit Langote
On 2017/03/04 4:24, Peter Eisentraut wrote: > On 2/27/17 01:57, Amit Langote wrote: >> I see that if the table is a inheritance parent, and ONLY is not >> specified, the child tables are also added to the publication. > >> If the child table is later removed from the inheritance hierarchy, it >>

Re: [HACKERS] Logical replication and inheritance

2017-03-03 Thread Peter Eisentraut
On 2/27/17 01:57, Amit Langote wrote: > I see that if the table is a inheritance parent, and ONLY is not > specified, the child tables are also added to the publication. > If the child table is later removed from the inheritance hierarchy, it > continues to be a part of the publication. >

[HACKERS] Logical replication and inheritance

2017-02-26 Thread Amit Langote
I see that if the table is a inheritance parent, and ONLY is not specified, the child tables are also added to the publication. create table parent (a int); create table child () inherits (parent); create publication parent_pub for table parent; \d parent Table "public.parent"