> Is there a simple, user-accessible mechanism to schedule a function to
> be run at query commit ?
CONSTRAINT TRIGGER (DEFERRABLE)
It is kinda hack, because CONSTRAINT TRIGGERs are not indended for such use,
But there are no other "ON COMMIT" triggers in postgresql.