> ERROR: blah blah > CODE: 12345 > LOCATION: some/file.c line NNN It might be handy to have the LOCATION in the postmaster log, or make it something that needs to be explicitly switched on. I do not think it is of general interest to users (most errors will result from normal operation, and not bugs that need to be tracked). Since access to SQLSTATE will become a hot path once savepoints are available I think that having SQLSTATE up front would be more convenient. exec sql insert into blabla values ....; if (strncmp(sqlca.sqlstate, "23", 2) == 0) // duplicate key value exec sql update blabla set ... ; Andreas ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html