Skip site navigation (1) Skip section navigation (2)

Re: Expanding DELETE/UPDATE returning

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Cc: David Fetter <david(at)fetter(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rusty Conover <rconover(at)infogears(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Expanding DELETE/UPDATE returning
Date: 2007-03-02 18:47:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Tue, Feb 27, 2007 at 15:07:06 +0100,
  "Florian G. Pflug" <fgp(at)phlo(dot)org> wrote:
> select * from t1, (delete from t2 returning t2.t1_id) where = 
> t2.t1_id limit 1 ;
> I for my part couldn't even say what I'd expect that query to do.

I would expect it to delete all rows from t2 but only return 1 row as output.

I think the ambiguous cases are going to come from cases where deleting
some rows in a subquery changes which rows will be deleted in subsequent
executions of the same subquery. Something like deleting the row with the
least value for some column.

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-03-02 18:49:14
Subject: Re: GIST and TOAST
Previous:From: Andrew - SupernewsDate: 2007-03-02 18:41:08
Subject: Re: GIST and TOAST

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group