Re: Support TRUNCATE triggers on foreign tables

2022-07-12 Thread Yugo NAGATA
On Tue, 12 Jul 2022 09:24:20 +0900 Fujii Masao wrote: > > > On 2022/07/08 17:13, Ian Lawrence Barwick wrote: > >> If we want to add such prevention, we will need similar checks for > >> INSERT/DELETE/UPDATE not only TRUNCATE. However, I think such fix is > >> independent > >> from this and it

Re: Support TRUNCATE triggers on foreign tables

2022-07-11 Thread Fujii Masao
On 2022/07/08 17:13, Ian Lawrence Barwick wrote: If we want to add such prevention, we will need similar checks for INSERT/DELETE/UPDATE not only TRUNCATE. However, I think such fix is independent from this and it can be proposed as another patch. Ah OK, makes sense from that point of view.

Re: Support TRUNCATE triggers on foreign tables

2022-07-08 Thread Ian Lawrence Barwick
2022年7月8日(金) 17:10 Yugo NAGATA : > > On Fri, 8 Jul 2022 16:50:10 +0900 > Ian Lawrence Barwick wrote: > > > 2022年7月8日(金) 14:06 Fujii Masao : > > > On 2022/07/08 11:19, Yugo NAGATA wrote: > > > >> You added "foreign tables" for BEFORE statement-level trigger as the > > > >> above, but ISTM that you

Re: Support TRUNCATE triggers on foreign tables

2022-07-08 Thread Yugo NAGATA
On Fri, 8 Jul 2022 16:50:10 +0900 Ian Lawrence Barwick wrote: > 2022年7月8日(金) 14:06 Fujii Masao : > > On 2022/07/08 11:19, Yugo NAGATA wrote: > > >> You added "foreign tables" for BEFORE statement-level trigger as the > > >> above, but ISTM that you also needs to do that for AFTER statement-level

Re: Support TRUNCATE triggers on foreign tables

2022-07-08 Thread Ian Lawrence Barwick
2022年7月8日(金) 14:06 Fujii Masao : > On 2022/07/08 11:19, Yugo NAGATA wrote: > >> You added "foreign tables" for BEFORE statement-level trigger as the > >> above, but ISTM that you also needs to do that for AFTER statement-level > >> trigger. No? > > > > Oops, I forgot it. I attached the updated pa

Re: Support TRUNCATE triggers on foreign tables

2022-07-07 Thread Fujii Masao
On 2022/07/08 11:19, Yugo NAGATA wrote: You added "foreign tables" for BEFORE statement-level trigger as the above, but ISTM that you also needs to do that for AFTER statement-level trigger. No? Oops, I forgot it. I attached the updated patch. Thanks for updating the patch! LGTM. Barring

Re: Support TRUNCATE triggers on foreign tables

2022-07-07 Thread Yugo NAGATA
Hello Fujii-san, Thank you for reviewing the patch! On Fri, 8 Jul 2022 00:54:37 +0900 Fujii Masao wrote: > > > On 2022/06/30 19:38, Yugo NAGATA wrote: > > Hello, > > > > I propose supporting TRUNCATE triggers on foreign tables > > because some FDW now supports TRUNCATE. I think such triggers

Re: Support TRUNCATE triggers on foreign tables

2022-07-07 Thread Fujii Masao
On 2022/06/30 19:38, Yugo NAGATA wrote: Hello, I propose supporting TRUNCATE triggers on foreign tables because some FDW now supports TRUNCATE. I think such triggers are useful for audit logging or for preventing undesired truncate. Patch attached. Thanks for the patch! It looks good to me

Support TRUNCATE triggers on foreign tables

2022-06-30 Thread Yugo NAGATA
Hello, I propose supporting TRUNCATE triggers on foreign tables because some FDW now supports TRUNCATE. I think such triggers are useful for audit logging or for preventing undesired truncate. Patch attached. Regards, Yugo Nagata -- Yugo NAGATA diff --git a/contrib/postgres_fdw/expected/postg