Re: Expanding DELETE/UPDATE returning

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Expanding DELETE/UPDATE returning
Дата
Msg-id 20070302184721.GA31806@wolff.to
обсуждение исходный текст
Ответ на Re: Expanding DELETE/UPDATE returning  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-hackers
On Tue, Feb 27, 2007 at 15:07:06 +0100, "Florian G. Pflug" <fgp@phlo.org> wrote:
> 
> select * from t1, (delete from t2 returning t2.t1_id) where t1.id = 
> 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.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: UPSERT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: GIST and TOAST