Re: Minor improvement to delete.sgml

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема Re: Minor improvement to delete.sgml
Дата
Msg-id c04315e3-7c63-5f21-a4f7-7b36962d4473@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Minor improvement to delete.sgml  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Minor improvement to delete.sgml
Список pgsql-hackers
On 2016/10/19 2:51, Robert Haas wrote:
> On Fri, Oct 14, 2016 at 12:05 AM, Etsuro Fujita
> <fujita.etsuro@lab.ntt.co.jp> wrote:
>> 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);
CREATE TABLE
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;
DELETE 1

Am I missing something?

Sorry for the delay.

Best regards,
Etsuro Fujita





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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Fix checkpoint skip logic on idle systems by tracking LSN progress
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Fix checkpoint skip logic on idle systems by tracking LSN progress