Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Andres Freund
On 2016-08-05 16:44:20 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2016-08-05 16:35:02 -0400, Tom Lane wrote: > >> In particular, it seems to me that rather than implement just this, > >> we really ought to provide an API that lets FDWs actually implement > >> TRUNCATE if they feel like

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Tom Lane
Andres Freund writes: > On 2016-08-05 16:35:02 -0400, Tom Lane wrote: >> In particular, it seems to me that rather than implement just this, >> we really ought to provide an API that lets FDWs actually implement >> TRUNCATE if they feel like it. Having the trigger and not TRUNCATE >> capability i

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Andres Freund
On 2016-08-05 16:35:02 -0400, Tom Lane wrote: > In particular, it seems to me that rather than implement just this, > we really ought to provide an API that lets FDWs actually implement > TRUNCATE if they feel like it. Having the trigger and not TRUNCATE > capability itself just screams "half bake

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Tom Lane
Andres Freund writes: > On 2016-08-05 14:05:02 -0400, Robert Haas wrote: >> I agree, but I still think it's weird if foreign tables support >> TRUNCATE itself not but triggers on TRUNCATE. > You mean the other way round? To me this seems very comparable to > INSTEAD triggers, but ... While I ha

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Andres Freund
On 2016-08-05 14:05:02 -0400, Robert Haas wrote: > On Fri, Aug 5, 2016 at 2:04 PM, Andres Freund wrote: > > On 2016-08-05 13:32:18 -0400, Robert Haas wrote: > >> I think if we're going to add support utility commands on foreign > >> tables, we ought to think about all of the different utility comm

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Robert Haas
On Fri, Aug 5, 2016 at 2:04 PM, Andres Freund wrote: > On 2016-08-05 13:32:18 -0400, Robert Haas wrote: >> I think if we're going to add support utility commands on foreign >> tables, we ought to think about all of the different utility commands >> that someone might want and what exactly we want

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Andres Freund
On 2016-08-05 13:32:18 -0400, Robert Haas wrote: > I think if we're going to add support utility commands on foreign > tables, we ought to think about all of the different utility commands > that someone might want and what exactly we want the behavior to be. > For example, consider CLUSTER or CRE

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Robert Haas
On Fri, Aug 5, 2016 at 10:39 AM, Andres Freund wrote: > On 2016-08-05 10:33:49 -0400, Tom Lane wrote: >> Murat Tuncer writes: >> > I recently hit a road blocker when I tried to create a truncate trigger on >> > a foreign table. trigger.c::CreateTrigger() function has explicit check to >> > block

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Andres Freund
On 2016-08-05 10:33:49 -0400, Tom Lane wrote: > Murat Tuncer writes: > > I recently hit a road blocker when I tried to create a truncate trigger on > > a foreign table. trigger.c::CreateTrigger() function has explicit check to > > block truncate trigger on foreign tables. > > That's good, because

Re: [HACKERS] truncate trigger for foreign data wrappers

2016-08-05 Thread Tom Lane
Murat Tuncer writes: > I recently hit a road blocker when I tried to create a truncate trigger on > a foreign table. trigger.c::CreateTrigger() function has explicit check to > block truncate trigger on foreign tables. That's good, because we don't implement TRUNCATE on foreign tables: there is n