Re: truncate trigger for foreign data wrappers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Murat Tuncer <mtuncer(at)citusdata(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: truncate trigger for foreign data wrappers
Date: 2016-08-05 20:35:02
Message-ID: 24770.1470429302@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-08-05 20:41:25 Re: truncate trigger for foreign data wrappers
Previous Message David G. Johnston 2016-08-05 20:22:27 Add hint for people who place EXECUTE USING arguments in parentheses (in plpgsql)