Closed thaumant closed 9 years ago
versioning
is not a usual function. It is a trigger function. So, the proper way to call it will be return versioning()
, but this will not work since trigger functions cannot be called outside triggers (at least you cannot do this from a PL/pgSQL function).
If you are trying to add the versioning logic in addition to other things, just add another trigger, they will be fired in alphabetic order by name.
trigger functions cannot be called outside triggers
That "function does not exist" message was confusing :-) Anyway, that's the piece I was missing. Thank you!
When I create trigger as in your README it works just fine, I update a row and see result in the history table. Trigger looks like this:
But when I try to execute versioning function within another function I get an error:
Procedure and trigger look like this:
I suppose the problem is not in the temporal_tables extension but I'm new to plpgsql and would appreciate any help.