Vams <vmudrageda@charter.net> writes:
> Important point: I need this to be a generic function. I got multiple
> tables that have a id column, each with their own unique sequences,
> and I want to use the same function for all of them. So NEW.id :=
> nextval('some_sequence') can't work.
Nonetheless, that is the direction you want to go.
Consider passing the appropriate sequence name to the function as a
trigger parameter.
regards, tom lane