Re: DELETE ... USING LATERAL - Mailing list pgsql-general

From Tom Lane
Subject Re: DELETE ... USING LATERAL
Date
Msg-id 4004827.1633375651@sss.pgh.pa.us
Whole thread Raw
In response to Re: DELETE ... USING LATERAL  (Michael Lewis <mlewis@entrata.com>)
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Postgres PANIC when it could not open file in pg_logical/snapshots directory
Next
From: Alban Hertroys
Date:
Subject: Re: Growth planning