On 1/21/16 4:57 PM, Pavel Stehule wrote:
It is not correct - outside PLPython you got a Error (PostgreSQL error
has not any classes), and isn't important the raising class (Error or
SPIError). Inside PL/Python you will got SPIError or successors (based
Right. The closest thing we have to error classes is SQLSTATE. If
someone found a clever way to setup an exception inheritance tree on
that then maybe different exceptions would make sense. Short of that, I
don't see it.
 There's a hierarchy to the SQL state codes, based on the first 2
characters. So if there was...
str = 'Connection Exception'
str = 'Connection Does Not Exist"
to map to the small set of errors below, maybe that would make sense.
Obviously that would need to be auto-generated. It seems more trouble
than it's worth though.
Section: Class 08 - Connection Exception
08000 E ERRCODE_CONNECTION_EXCEPTION
08003 E ERRCODE_CONNECTION_DOES_NOT_EXIST
08006 E ERRCODE_CONNECTION_FAILURE
08001 E ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION
08004 E ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION
08007 E ERRCODE_TRANSACTION_RESOLUTION_UNKNOWN
08P01 E ERRCODE_PROTOCOL_VIOLATION
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: