Shakti Singh <shakti.0123@gmail.com> writes:
> In oracle sqlcode and sqlerrm can be accessed in a function called from an
> exception block.
> How do I do this in PostgreSQL
In PG those are local variables within an exception block. You'd have to
pass their values to the error-logging function explicitly.
regards, tom lane