Re: Delete function - Mailing list pgsql-general

From Richard Huxton
Subject Re: Delete function
Date
Msg-id 41B46651.7050409@archonet.com
Whole thread Raw
In response to Delete function  (Secrétariat <ets@rolland-fr.com>)
List pgsql-general
Secrétariat wrote:
> Hello !
>
> I create a delete function :
> CREATE FUNCTION delalpha(varchar, integer) RETURNS boolean
>     AS 'DELETE FROM public.params WHERE soc = $1 AND numpar = $2 ;
>           SELECT  TRUE ;'
>     LANGUAGE sql ;
> Is there a way to return the number of deleted row ?
> Thanks.

If you rewrote the function in plpgsql, you could use "GET DIAGNOSTICS"
- see the manual plpgsql/Obtaining the result status.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Pierre-Frédéric Caillaud
Date:
Subject: Re: select single entry and its neighbours using direct-acess to index?
Next
From: "David Esposito"
Date:
Subject: Performance tuning on RedHat Enterprise Linux 3