Re: DELETE ... USING LATERAL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DELETE ... USING LATERAL
Дата
Msg-id 4004827.1633375651@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: DELETE ... USING LATERAL  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-general
Michael Lewis <mlewis@entrata.com> writes:
> On Mon, Oct 4, 2021, 10:30 AM Nikhil Benesch <nikhil.benesch@gmail.com>
> wrote:
>> # delete from int_arrays using int_arrays;
>> ERROR:  table name "int_arrays" specified more than once

>> Don't you need to use an alias for the table in the using clause?

You could, but then you'd be creating a self-join on the target table
(and would need to add suitable WHERE clauses to constrain that join).
This might be the best near-term workaround, but it does seem ugly
and inefficient.

            regards, tom lane



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Postgres PANIC when it could not open file in pg_logical/snapshots directory
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: Growth planning