Question about catching exception

From: A B <gentosaker(at)gmail(dot)com>
To: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Question about catching exception
Date: 2010-11-26 09:39:55
Message-ID: AANLkTikhV_jiroxUNT+WbVv4myCxrasFajO0TfdtdEK+@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2010-11-26 09:52:48 Re: Question about catching exception
Previous Message Murat Kabilov 2010-11-26 09:33:02 number of not null arguments