Re: plpgsql and INSERT/UPDATE/DELETE RETURNING - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: plpgsql and INSERT/UPDATE/DELETE RETURNING
Date
Msg-id 200608140230.k7E2U0x28810@momjian.us
Whole thread Raw
In response to plpgsql and INSERT/UPDATE/DELETE RETURNING  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> With STRICT: you get an error unless exactly one row is affected.
> 
> This prevents the incomplete-execution problem.
> 
> BTW, some googling indicates that Oracle's equivalent PL/SQL construct
> supports only the exactly-one-row case.  But they have an alternative,
> which is that you can use aggregate functions in the RETURNING list and
> get a single-row result that is aggregated across all affected rows.
> It's too late to consider implementing that for 8.2, I fear, but I think
> maybe we should put it on the TODO list for later.

Interesting, an aggregate to combine the rows.  Remembering how much
trouble/discussion the STRICT was, I am unsure if we should add this to
the TODO unless we get someone who likes it.  ;-)

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Custom variable class segmentation fault
Next
From: Bruce Momjian
Date:
Subject: I am away Monday to Friday