Re: BUG #16868: Cannot find sqlstat error codes. - Mailing list pgsql-bugs

From Euler Taveira
Subject Re: BUG #16868: Cannot find sqlstat error codes.
Date
Msg-id e755ddf7-d6cb-4c60-9519-0ede6f78c36c@www.fastmail.com
Whole thread Raw
In response to Re: BUG #16868: Cannot find sqlstat error codes.  (bipsy Nair <nbipin29@gmail.com>)
Responses Re: BUG #16868: Cannot find sqlstat error codes.  (bipsy Nair <nbipin29@gmail.com>)
List pgsql-bugs
On Tue, Feb 16, 2021, at 12:21 PM, bipsy Nair wrote:
Here is the code with the required error and details. I tested this in all Postgres versions.
postgres=# \i /tmp/b16868.sql
DROP TABLE
CREATE TABLE
INSERT 0 1000
ALTER TABLE
psql:/tmp/b16868.sql:19: ERROR:  duplicate key value violates unique constraint "pk_error_logging"
DETAIL:  Key (id)=(1) already exists.
postgres=# \errverbose
ERROR:  23505: duplicate key value violates unique constraint "pk_error_logging"
DETAIL:  Key (id)=(1) already exists.
SCHEMA NAME:  public
TABLE NAME:  bipin
CONSTRAINT NAME:  pk_error_logging
LOCATION:  _bt_check_unique, nbtinsert.c:656

The sqlstate (23505) is reported accordingly. Since you are using Aurora and it
is not Postgres, it should possibly omit the sqlstate in the error message stack.    
The other possibility is that aurora-data-api is not gathering the sqlstate.      
I'm afraid you won't find both answers here.


--
Euler Taveira

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16871: Insert with wrong key field, causing later crash of DB.
Next
From: "Euler Taveira"
Date:
Subject: Re: PITR restores incorrect state