On 2016/10/19 2:51, Robert Haas wrote:
On Fri, Oct 14, 2016 at 12:05 AM, Etsuro Fujita
I think it's better to mention that an alias is needed for the target table
specified in the USING clause of a DELETE statement, to set up a self-join,
as the documentation on the from_list parameter of UPDATE does. Please find
attached a patch.
The statement you are proposing to add to the documentation isn't true.
Consider a counterexample of DELETE doing a self-join of a target table:
postgres=# create table t1 (c1 int);
postgres=# insert into t1 values (1);
INSERT 0 1
postgres=# delete from t1 using t1 where t1.c1 = t1.c1;
ERROR: table name "t1" specified more than once
Giving an alias to the target table t1 in the USING clause,
postgres=# delete from t1 using t1 r1 where t1.c1 = r1.c1;
Am I missing something?
Sorry for the delay.
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: