Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-04-07 Thread Peter Eisentraut
This part of the patch didn't end up being necessary, since the updated implementation of logical decoding of TRUNCATE could do without it. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-03-20 Thread Peter Eisentraut
So, what should we do here? The argument of the patch is that it makes the behavior of TRUNCATE consistent with DELETE, which would be good. But my argument is that the behavior of DELETE is kind of bad, and we should create more stuff like that. I also haven't seen an argument why this change is

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-23 Thread Petr Jelinek
On 23/01/18 13:34, Marco Nenciarini wrote: > Il 22/01/18 19:41, Petr Jelinek ha scritto: >> On 19/01/18 12:41, Marco Nenciarini wrote: >>> Hi Peter, >>> >>> Il 18/01/18 17:30, Peter Eisentraut ha scritto: On 1/17/18 11:33, Petr Jelinek wrote: >> P.S: I'm struggling to understand why we hav

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-23 Thread Marco Nenciarini
Il 22/01/18 19:41, Petr Jelinek ha scritto: > On 19/01/18 12:41, Marco Nenciarini wrote: >> Hi Peter, >> >> Il 18/01/18 17:30, Peter Eisentraut ha scritto: >>> On 1/17/18 11:33, Petr Jelinek wrote: > P.S: I'm struggling to understand why we have two possible values of > session_replication_

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-22 Thread Peter Eisentraut
On 1/18/18 12:41, Tom Lane wrote: > Peter Eisentraut writes: >> So I'm proposing the attached alternative patch, which creates >> constraint triggers to be TRIGGER_FIRES_ALWAYS by default. >> Thoughts? > > Hm, the general idea seems attractive, but I'm not sure we want > this behavioral change fo

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-22 Thread Peter Eisentraut
On 1/19/18 05:31, Simon Riggs wrote: >> I'm not aware of an explanation why it currently works the way it does, >> other than that FKs happen to be implemented by triggers and triggers >> happen to work that way. But I think it's pretty bogus that logical >> replication subscriptions can insert da

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-22 Thread Petr Jelinek
On 19/01/18 12:41, Marco Nenciarini wrote: > Hi Peter, > > Il 18/01/18 17:30, Peter Eisentraut ha scritto: >> On 1/17/18 11:33, Petr Jelinek wrote: P.S: I'm struggling to understand why we have two possible values of session_replication_role settings that behave identically (origin and >

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-19 Thread Marco Nenciarini
Hi Peter, Il 18/01/18 17:30, Peter Eisentraut ha scritto: > On 1/17/18 11:33, Petr Jelinek wrote: >>> P.S: I'm struggling to understand why we have two possible values of >>> session_replication_role settings that behave identically (origin and >>> local). I'm unable to see any difference accordin

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-19 Thread Simon Riggs
On 18 January 2018 at 17:14, Peter Eisentraut wrote: > On 12/29/17 07:01, Marco Nenciarini wrote: >> The current behavior of session_replication_role = replica with TRUNCATE >> is not the same of with the other commands. >> It does not check FKs for INSERT/UPDATE/DELETE but it does for TRUNCATE, >

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-18 Thread Tom Lane
Peter Eisentraut writes: > So I'm proposing the attached alternative patch, which creates > constraint triggers to be TRIGGER_FIRES_ALWAYS by default. > Thoughts? Hm, the general idea seems attractive, but I'm not sure we want this behavioral change for user-created triggers. Can we make it happ

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-18 Thread Peter Eisentraut
On 12/29/17 07:01, Marco Nenciarini wrote: > The current behavior of session_replication_role = replica with TRUNCATE > is not the same of with the other commands. > It does not check FKs for INSERT/UPDATE/DELETE but it does for TRUNCATE, > so one cannot execute TRUNCATE on a table when it is possi

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-18 Thread Peter Eisentraut
On 1/17/18 11:33, Petr Jelinek wrote: >> P.S: I'm struggling to understand why we have two possible values of >> session_replication_role settings that behave identically (origin and >> local). I'm unable to see any difference according to the code or the >> documentation, so I'm wondering if we sh

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-17 Thread Petr Jelinek
Hi, On 02/01/18 17:16, Marco Nenciarini wrote: > Hi, > > I've tried to amend the documentation to be more clear. Feel free to > suggest further editing. Patch v2 attached. > I think the patch as is now looks okay. So marking as ready for committer. This is noteworthy for the release notes thou

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-01-02 Thread Marco Nenciarini
Hi, Il 30/12/17 08:42, Craig Ringer ha scritto: > On 30 December 2017 at 03:32, Petr Jelinek > wrote: > > On 29/12/17 16:53, Marco Nenciarini wrote: > > Il 29/12/17 15:14, Petr Jelinek ha scritto: > >> > >> May be worth documenting that the se

Re: [PATCH] session_replication_role = replica with TRUNCATE

2017-12-29 Thread Craig Ringer
On 30 December 2017 at 03:32, Petr Jelinek wrote: > On 29/12/17 16:53, Marco Nenciarini wrote: > > Il 29/12/17 15:14, Petr Jelinek ha scritto: > >> > >> May be worth documenting that the session_replication_role also affects > >> TRUNCATE's interaction with FKs in config.sgml. > >> > > > > The cu

Re: [PATCH] session_replication_role = replica with TRUNCATE

2017-12-29 Thread Petr Jelinek
On 29/12/17 16:53, Marco Nenciarini wrote: > Il 29/12/17 15:14, Petr Jelinek ha scritto: >> >> May be worth documenting that the session_replication_role also affects >> TRUNCATE's interaction with FKs in config.sgml. >> > > The current documentation of session_replication_role GUC is: > > Co

Re: [PATCH] session_replication_role = replica with TRUNCATE

2017-12-29 Thread Marco Nenciarini
Il 29/12/17 15:14, Petr Jelinek ha scritto: > > May be worth documenting that the session_replication_role also affects > TRUNCATE's interaction with FKs in config.sgml. > The current documentation of session_replication_role GUC is: Controls firing of replication-related triggers and rules

Re: [PATCH] session_replication_role = replica with TRUNCATE

2017-12-29 Thread Craig Ringer
On 29 December 2017 at 22:14, Petr Jelinek wrote: > Hi, > > On 29/12/17 13:01, Marco Nenciarini wrote: > > Hi, > > > > The current behavior of session_replication_role = replica with TRUNCATE > > is not the same of with the other commands. > > It does not check FKs for INSERT/UPDATE/DELETE but it

Re: [PATCH] session_replication_role = replica with TRUNCATE

2017-12-29 Thread Petr Jelinek
Hi, On 29/12/17 13:01, Marco Nenciarini wrote: > Hi, > > The current behavior of session_replication_role = replica with TRUNCATE > is not the same of with the other commands. > It does not check FKs for INSERT/UPDATE/DELETE but it does for TRUNCATE, > so one cannot execute TRUNCATE on a table wh

[PATCH] session_replication_role = replica with TRUNCATE

2017-12-29 Thread Marco Nenciarini
Hi, The current behavior of session_replication_role = replica with TRUNCATE is not the same of with the other commands. It does not check FKs for INSERT/UPDATE/DELETE but it does for TRUNCATE, so one cannot execute TRUNCATE on a table when it is possible to DELETE from table without WHERE clause.