postgresql, ERROR: 23505: duplicate key value violates unique constraint "clients_pkey

1,032 views
Skip to first unread message

Domenico D'Oria

unread,
Mar 31, 2015, 11:56:49 AM3/31/15
to harbou...@googlegroups.com
Hi folks

i do not know if anyone of you works with postgresql, or any other SQL ENGINE

well

i need to know if there is a way to receive the code number error reported by the server


or i have to extract it from the string received from the server


this could be useful to verify the presence of the primary key

an info could be in this postgresql info found in

http://www.postgresql.org/docs/current/static/libpq-exec.html

PG_DIAG_SQLSTATE

The SQLSTATE code for the error. The SQLSTATE code identifies the type of error that has occurred; it can be used by front-end applications to perform specific operations (such as error handling) in response to a particular database error. For a list of the possible SQLSTATE codes, see Appendix A. This field is not localizable, and is always present.


regards

Domenico

vszakats

unread,
Mar 31, 2015, 2:33:01 PM3/31/15
to harbou...@googlegroups.com

Domenico D'Oria

unread,
Apr 1, 2015, 10:53:39 AM4/1/15
to harbou...@googlegroups.com
Hi Viktor

many thanks for your big effort

regards

Domenico
Reply all
Reply to author
Forward
0 new messages