Re: truncate trigger for foreign data wrappers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: truncate trigger for foreign data wrappers
Date
Msg-id 24770.1470429302@sss.pgh.pa.us
Whole thread Raw
In response to Re: truncate trigger for foreign data wrappers  (Andres Freund <andres@anarazel.de>)
Responses Re: truncate trigger for foreign data wrappers  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> 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 have no particular objection to allowing TRUNCATE triggers on
FDWs, I concur with Robert's feeling that we ought to sketch out a plan
for what utility commands on foreign tables should do in general, before
we go introducing individual new features.  It would be annoying if we
stuck this in with little forethought and then found out it was
inconsistent with other stuff people want to add later.

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 baked", wouldn't you say?
        regards, tom lane



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Add hint for people who place EXECUTE USING arguments in parentheses (in plpgsql)
Next
From: Andres Freund
Date:
Subject: Re: truncate trigger for foreign data wrappers