Re: [BUGS] BUG #6572: The example of SPI_execute is bogus - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [BUGS] BUG #6572: The example of SPI_execute is bogus
Date
Msg-id CA+TgmobbJZSLb1mKj3QwRjk1LmtS5uZsmycf_oZMaF4FXSdFtA@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #6572: The example of SPI_execute is bogus  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Apr 15, 2012 at 12:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I think it would be a good idea for UPDATE and DELETE to expose
>> a LIMIT option, but I can't really see the virtue in making that
>> functionality available only through SPI.
>
> FWIW, I'm not excited about that.  You can get well-defined behavior
> today from a SELECT/LIMIT drawing from a writable CTE (namely, that
> the UPDATE/DELETE runs to completion but you only see a subset of
> its RETURNING result).  LIMIT directly on the UPDATE/DELETE would be
> ill-defined, unless perhaps you want to also invent a way of specifying
> the order in which rows get selected for update; but I don't want to
> go there.

In the use cases I'm thinking of, it doesn't matter which row you
decide to update or delete, only that you pick a single one.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Aggressive memory consumption in {ts,array}_typanalyze
Next
From: "Kevin Grittner"
Date:
Subject: Re: Bug tracker tool we need