pl/pgsql exceptions

Started by Shelby Cainover 21 years ago2 messagesgeneral
Jump to latest
#1Shelby Cain
alyandon@yahoo.com

Is there any way to retrieve the error code and error
message text when an exception has been caught via
"exception when others" in pl/pgsql? I'm looking
essentially for the equivalent of Oracle's pl/sql
sqlerrm and sqlcode variables.

Regards,

Shelby Cain

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Shelby Cain (#1)
Re: pl/pgsql exceptions

Shelby Cain <alyandon@yahoo.com> writes:

Is there any way to retrieve the error code and error
message text when an exception has been caught via
"exception when others" in pl/pgsql?

Not yet. I'm open to suggestions though ...

I'm looking
essentially for the equivalent of Oracle's pl/sql
sqlerrm and sqlcode variables.

We can't just copy those, since we aren't using SQLCODE error
numbers. I'm not sure how to map the error/detail/hint structure
into all this, either ... and does a plpgsql function want to see
localized message texts, or not?

regards, tom lane