How to distinguish serialization errors from others using pqxx

Started by Saimonabout 11 years ago3 messagesgeneral
Jump to latest
#1Saimon
aimon.slim@gmail.com

Hi

Is there any way to distinguish serialization errors from others using pqxx?

As far as I understand there is no way to get sql error code within pqxx
lib.
Ability to detect serialization errors is important to implement retrying
logic for this cases.

--
View this message in context: http://postgresql.nabble.com/How-to-distinguish-serialization-errors-from-others-using-pqxx-tp5843145.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Saimon
aimon.slim@gmail.com
In reply to: Saimon (#1)
Re: How to distinguish serialization errors from others using pqxx

As I undersand, the only way to determine serialization errors is to parse
pqxx::sql_error exceptions' messages for keywords like "could not serialize"
etc.

Or am I wrong?

Thanks in advance
Saimon

--
View this message in context: http://postgresql.nabble.com/How-to-distinguish-serialization-errors-from-others-using-pqxx-tp5843145p5843271.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Saimon (#2)
Re: How to distinguish serialization errors from others using pqxx

Saimon <aimon.slim@gmail.com> wrote:

As I undersand, the only way to determine serialization errors is
to parse pqxx::sql_error exceptions' messages for keywords like
"could not serialize" etc.

I had to do a web search to find out what pqxx was. It is a C++
connector for PostgreSQL that's been around for ten years and most
recently released a new version two months ago.

http://pqxx.org/development/libpqxx/

From there it was pretty easy to find that making the SQLSTATE
available to the programmer is recognized as a desirable
enhancement, but has not yet been done:

http://pqxx.org/development/libpqxx/ticket/219

So I guess that leaves one parsing the text of the error messages
and hoping you know what language is going to be there.

Should pqxx be included in the table of externally maintained
client interfaces?:

http://www.postgresql.org/docs/current/static/external-interfaces.html

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general