Question about catching exception - Mailing list pgsql-general

From A B
Subject Question about catching exception
Date
Msg-id AANLkTikhV_jiroxUNT+WbVv4myCxrasFajO0TfdtdEK+@mail.gmail.com
Whole thread Raw
Responses Re: Question about catching exception
List pgsql-general
Hello!

I have a question about catching exceptions.

If I write a plpgsql function like this

begin
   do stuff;
exception
 when X then
    ....
when Y then
  ...
end;

If the "do stuff" part can result in two different unique_violation
exception (having two unique constraints), how can I detect which one
was triggered?

pgsql-general by date:

Previous
From: "James B. Byrne"
Date:
Subject: Re: PGError: ERROR: missing FROM-clause entry for table
Next
From: Pavel Stehule
Date:
Subject: Re: Question about catching exception