Re: Create Produre for DROP row

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Marcos <mjs_ops(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Create Produre for DROP row
Date: 2006-01-11 18:42:09
Message-ID: c2d9e70e0601111042x6c7f84c7qf3b2fe52e59dc1a4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/11/06, Marcos <mjs_ops(at)gmx(dot)net> wrote:
> Hi,
>
> Does have possible create one procedure to delete a row that return TRUE
> if the deletion was success or FALSE if a error occur?
>
> The procedure for deletion I already create but I don't know how detect
> if the deletion was success executed.
>
> Languagel: plpgsql
>
> Thanks.
>

in 8.x.x

BEGIN

DELETE FROM .....

EXCEPTION
WHEN others THEN
...........
END;

documentation:
http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

a list of errors:
http://www.postgresql.org/docs/current/static/errcodes-appendix.html

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-11 18:54:04 Re: cursors as table sources
Previous Message Will Glynn 2006-01-11 18:41:31 Re: cursors as table sources