PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16048
PG Version12.0
OSWindows
Opened2019-10-11 14:03:35+00
Reported byFabio Henrique Gibon
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16048
Logged by:          Fabio Henrique Gibon
Email address:      (redacted)
PostgreSQL version: 12.0
Operating system:   Windows
Description:        

Hi,
 
        I have a database using LATIN1 (and I can't change it), so, when the
user informar a invalid character it is not captured in exception clause.
See a short sample:

DO $$
DECLARE 
   v varchar;

BEGIN

   v := 'ABCŸ';

EXCEPTION

WHEN others THEN
RAISE INFO 'Error State: %', SQLSTATE;

END$$;


I tried in old versions (9.0, 9.6,...) and the result is the same. The error
is propagated, disregarding the exception treatement.

Messages

DateAuthorSubject
2019-10-11 14:03:35+00PG Bug reporting formBUG #16048: SQLSTATE 22P05 is not captured in exception clause
2019-10-11 14:19:20+00Tom LaneRe: BUG #16048: SQLSTATE 22P05 is not captured in exception clause