Query on exception handling in PL/pgSQL

From: diya das <diyadas(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Query on exception handling in PL/pgSQL
Date: 2004-11-26 13:28:56
Message-ID: 20041126132856.96981.qmail@web54001.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am just a beginner in postgreSQL and writing some
functions in PL/pgSQL. I use the libpq interface in
the client to call this funtions. My pgsql function
does an insert to a table and I have opened a
transaction block before calling my function from the
client. When the insert operation fails due to unique
key violation the whole transaction aborts. Is there a
way I can handle this error in my pgsql funtion rather
that aborting and not executing the rest of the
operations?. I have a workaround , But I was wondering
if there is an inexpensive way of doing it.

Another query I have is related to returning values
from funtions. How can I return multiple values from a
function? Is there any support for OUT variable in
pgsql functions?
Any pointers on this is greatly appreciated.

Thanks
Diya.


__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2004-11-26 13:36:30 Re: PostgreSQL slow after VACUUM
Previous Message Pierre-Frédéric Caillaud 2004-11-26 13:00:48 Re: PostgreSQL slow after VACUUM