Re: BUG #16868: Cannot find sqlstat error codes.

From: bipsy Nair <nbipin29(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16868: Cannot find sqlstat error codes.
Date: 2021-02-17 18:28:43
Message-ID: CAPu21XSRWzkmaA6ca_rTu7Ewnfj1o=A_uFvhMgdAj+CfuiiM7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thank you for the clarification. But why do i dont see the SQLSTATE code
for Postgres as per my test on psql clients etc.

As its not showing the errorcode , thats the reason boto3 is not able to
capture the error code.
Please advice if you have any thoughts on this as its confusing and
developer thinks its some limitations on RDS side.

On Wed, Feb 17, 2021 at 10:23 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Wednesday, February 17, 2021, bipsy Nair <nbipin29(at)gmail(dot)com> wrote:
>
>>
>> 4. Test on Postgres with parameter ==> log_error_verbosity=verbose
>> SELECT name, setting FROM pg_settings WHERE name LIKE
>> 'log_error_verbosity';
>>
>> postgres=> create table bipin (id int);
>> ERROR: relation "bipin" already exists
>> postgres=> insert into bipin values(1);
>> ERROR: duplicate key value violates unique constraint "pk_error_logging"
>> ==> NO SQL STATE captured.
>> DETAIL: Key (id)=(1) already exists.
>>
>
> That setting is for the log file, but you are showing what the client sees
> (which the server doesn’t really care about or influence - beyond
> client_min_message anyway).
>
>
>
>> But when i run the following it shows.
>> postgres=> \errverbose
>> ERROR: 23505: duplicate key value violates unique constraint
>> "pk_error_logging"
>>
>
> Which proves the server is doing its job of sending back that data as
> specified in the protocol.
>
>
>>
>> So we need a workaround wherein it can show the SQLSTATE code and want to
>> know if its limitation at Postgres DB level.
>>
>
>
> No, its not a server limitation, its a client limitation - in this case
> boto3.
>
> David J.
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-02-17 18:34:00 Re: BUG #16868: Cannot find sqlstat error codes.
Previous Message David G. Johnston 2021-02-17 18:23:20 Re: BUG #16868: Cannot find sqlstat error codes.