Re: Command Triggers - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Command Triggers
Date
Msg-id m2lipbrz83.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Command Triggers  (Andres Freund <andres@anarazel.de>)
Responses Re: Command Triggers  (Andres Freund <andres@anarazel.de>)
Re: Command Triggers  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I personally think this is an error and those details should at least be 
> available on the c level (e.g. some pg_command_trigger_get_plan() function, 
> only available via C) to allow sensible playing around with that knowledge. I 
> don't really see making progress towards a nice interface unless we get 
> something to play around with out there.

If you target C coded triggers then all you need to do is provide a
pointer to the Node *parsetree, I would think.  What else?

The drawback though is still the same, the day you do that you've
proposed a public API and changing the parsetree stops being internal
refactoring.  The way around this problem is that if you want a command
trigger in C, just write an extension that implements the Process
Utility hook.  Bonus, you can have that working with already released
versions of PostgreSQL.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Multithread Query Planner
Next
From: Tomas Vondra
Date:
Subject: Re: Review of: explain / allow collecting row counts without timing info