Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-25 Thread Amit Kapila
On Mon, May 24, 2021 at 2:18 PM Bharath Rupireddy wrote: > > On Mon, May 24, 2021 at 11:22 AM Amit Kapila wrote: > > I don't deny that this can allow some additional cases than we allow > > today but was just not sure whether users really need it. If we want > > to go with such an option then as

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-24 Thread Bharath Rupireddy
On Mon, May 24, 2021 at 11:22 AM Amit Kapila wrote: > I don't deny that this can allow some additional cases than we allow > today but was just not sure whether users really need it. If we want > to go with such an option then as mentioned earlier, we should > consider another proposal for subscri

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-23 Thread Amit Kapila
On Sat, May 22, 2021 at 10:33 AM Dilip Kumar wrote: > > On Thu, May 20, 2021 at 5:03 PM Amit Kapila wrote: > > > > On Fri, May 7, 2021 at 6:06 PM Dilip Kumar wrote: > > > > > > On Mon, May 3, 2021 at 6:08 PM Bharath Rupireddy > > > wrote: > > > > > > > > Having said that, isn't it good if we ca

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-21 Thread Dilip Kumar
On Thu, May 20, 2021 at 5:03 PM Amit Kapila wrote: > > On Fri, May 7, 2021 at 6:06 PM Dilip Kumar wrote: > > > > On Mon, May 3, 2021 at 6:08 PM Bharath Rupireddy > > wrote: > > > > > > Having said that, isn't it good if we can provide a subscription > > > (CREATE/ALTER) level option say "cascade

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-21 Thread Bharath Rupireddy
On Fri, May 21, 2021 at 3:39 PM Bharath Rupireddy wrote: > > Having said that, I see a different use case of such an option which > > is related to the proposal [1] where the patch provides a truncate > > option to truncate tables before initial sync. The cascade option > > could be useful in that

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-21 Thread Bharath Rupireddy
On Thu, May 20, 2021 at 5:03 PM Amit Kapila wrote: > > On Fri, May 7, 2021 at 6:06 PM Dilip Kumar wrote: > > > > On Mon, May 3, 2021 at 6:08 PM Bharath Rupireddy > > wrote: > > > > > > Having said that, isn't it good if we can provide a subscription > > > (CREATE/ALTER) level option say "cascade

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-20 Thread Amit Kapila
On Fri, May 7, 2021 at 6:06 PM Dilip Kumar wrote: > > On Mon, May 3, 2021 at 6:08 PM Bharath Rupireddy > wrote: > > > > Having said that, isn't it good if we can provide a subscription > > (CREATE/ALTER) level option say "cascade"(similar to other options > > such as binary, synchronous_commit, s

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-07 Thread Dilip Kumar
On Mon, May 3, 2021 at 6:08 PM Bharath Rupireddy wrote: > > Having said that, isn't it good if we can provide a subscription > (CREATE/ALTER) level option say "cascade"(similar to other options > such as binary, synchronous_commit, stream) default being false, when > set to true, we send upstream

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-03 Thread Bharath Rupireddy
On Mon, May 3, 2021 at 1:02 PM Dilip Kumar wrote: > > I think you are comparing the user-exposed behavior with the internal > code comments. The meaning of the comments is that it should not > truncate any table on subscriber using cascade, because there might be > some subscriber-specific relati

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-03 Thread Dilip Kumar
sh,On Mon, May 3, 2021 at 12:37 PM Bharath Rupireddy wrote: > > On Mon, May 3, 2021 at 11:59 AM Dilip Kumar wrote: > > > > On Mon, May 3, 2021 at 10:42 AM Bharath Rupireddy > > wrote: > > > > > > Hi, > > > > > > In apply_handle_truncate, the following comment before > > > ExecuteTruncateGuts s

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-03 Thread Bharath Rupireddy
On Mon, May 3, 2021 at 11:59 AM Dilip Kumar wrote: > > On Mon, May 3, 2021 at 10:42 AM Bharath Rupireddy > wrote: > > > > Hi, > > > > In apply_handle_truncate, the following comment before ExecuteTruncateGuts > > says that it defaults to RESTRICT even if the CASCADE option has been > > specifie

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-02 Thread Dilip Kumar
On Mon, May 3, 2021 at 10:42 AM Bharath Rupireddy wrote: > > Hi, > > In apply_handle_truncate, the following comment before ExecuteTruncateGuts > says that it defaults to RESTRICT even if the CASCADE option has been > specified in publisher's TRUNCATE command. > /* > * Even if we used C

Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-02 Thread Bharath Rupireddy
Hi, In apply_handle_truncate, the following comment before ExecuteTruncateGuts says that it defaults to RESTRICT even if the CASCADE option has been specified in publisher's TRUNCATE command. /* * Even if we used CASCADE on the upstream primary we explicitly default * to replaying ch