"Marc Mamin" <M.Mamin@intershop.de> writes:
> Can I optimize this function with:
> a) remove the EXCEPTION clause (Is there an underlying lock that prevent
> concurrent inserts ?)
No.
> b) declare the function being IMMUTABLE ?
Certainly not --- it's got side-effects.
regards, tom lane