Re: DELETE with LIMIT (or my first hack)

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: DELETE with LIMIT (or my first hack)
Дата
Msg-id AANLkTimc6qdcD9c+MJS+85dpbY6ovvbmQVrZRtkbq5ey@mail.gmail.com
обсуждение исходный текст
Ответ на Re: DELETE with LIMIT (or my first hack)  (Csaba Nagy <ncslists@googlemail.com>)
Ответы Re: DELETE with LIMIT (or my first hack)  (Csaba Nagy <ncslists@googlemail.com>)
Список pgsql-hackers
On Tue, Nov 30, 2010 at 4:25 AM, Csaba Nagy <ncslists@googlemail.com> wrote:
> The workaround recommended some time ago by Tom is:
>
> DELETE FROM residents_of_athens WHERE ctid = any(array(SELECT ctid FROM
> residents_of_athens ORDER BY ostracism_votes DESC LIMIT 1));
>
> It is about as efficient as the requested feature would be, just uglier
> to write down. I use it all the time when batch-deleting something large
> (to avoid long running transactions and to not crash slony). It also
> helps to vacuum frequently if you do that on large amount of data...

That's a very elegant hack, but not exactly obvious to a novice user
or, say, me.  So I think it'd be nicer to have the obvious syntax
work.

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


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Tab completion for view triggers in psql
Следующее
От: Robert Haas
Дата:
Сообщение: Re: GiST insert algorithm rewrite