Re: BUG #6572: The example of SPI_execute is bogus

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: BUG #6572: The example of SPI_execute is bogus
Date: 2012-04-18 15:11:14
Message-ID: CA+TgmobbJZSLb1mKj3QwRjk1LmtS5uZsmycf_oZMaF4FXSdFtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sun, Apr 15, 2012 at 12:29 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2012-04-18 15:45:28 Re: BUG #6204: Using plperl functions generate crash
Previous Message Alvaro Herrera 2012-04-18 15:02:25 Re: BUG #6593: REASSIGN OWNED fails on extensions

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2012-04-18 15:29:35 Re: Bug tracker tool we need
Previous Message Robert Haas 2012-04-18 15:09:12 Re: Aggressive memory consumption in {ts,array}_typanalyze