Remove "FROM" in "DELETE FROM" when using tab-completion

Поиск
Список
Период
Сортировка
Искать
От
tanghy.fnst@fujitsu.com
Тема
Remove "FROM" in "DELETE FROM" when using tab-completion
Дата
в 05:36:35
Msg-id
OS0PR01MB61135AE2B07CCD1AB8C6A0F6FB549@OS0PR01MB6113.jpnprd01.prod.outlook.com
Список
Дерево обсуждения
Remove "FROM" in "DELETE FROM" when using tab-completion "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Julien Rouhaud <rjuju123@gmail.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Dilip Kumar <dilipbalaut@gmail.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Julien Rouhaud <rjuju123@gmail.com>
RE: Remove "FROM" in "DELETE FROM" when using tab-completion "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Julien Rouhaud <rjuju123@gmail.com>
RE: Remove "FROM" in "DELETE FROM" when using tab-completion "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Dilip Kumar <dilipbalaut@gmail.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Michael Paquier <michael@paquier.xyz>
RE: Remove "FROM" in "DELETE FROM" when using tab-completion "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Dilip Kumar <dilipbalaut@gmail.com>
RE: Remove "FROM" in "DELETE FROM" when using tab-completion "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Dilip Kumar <dilipbalaut@gmail.com>
RE: Remove "FROM" in "DELETE FROM" when using tab-completion "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
Re: Remove "FROM" in "DELETE FROM" when using tab-completion Michael Paquier <michael@paquier.xyz>
Hi

When using psql help with SQL commands, I found an inconsistency tab-completion for command "DELETE" as follows.

=# \h de[TAB]
deallocate   declare      delete from

=# \help[TAB]
ABORT                      CLUSTER                    DELETE FROM

=# \help[ENTER]
Available help:
...
ANALYZE                          CREATE OPERATOR CLASS            DELETE
...

=# \h delete
Command:     DELETE
Description: delete rows of a table
...

You see, the tab-completion for "DELETE" is "DELETE FROM" which is not same as help-command said(which is "DELETE").
I tried to figure out why "FROM" is introduced here, but no good result got. In [1] someone changed "DELETE" to "DELETE FROM" but no reason added.

IMO, the "FROM" is unnecessary just like "INTO" for "INSERT" command. So I tried to fix the inconsistency by removing "FROM" from "DELETE FROM" in tab-complete.c.
Please see the attached patch. Any comment or different thought is very welcome.

[1]
https://github.com/postgres/postgres/commit/4c1f9a0f0bb41c31b26bb88ba8c5d3fca4521dd7

Regards,
Tang
В списке pgsql-hackers по дате отправления
От: Peter Smith
Дата:
От: Julien Rouhaud
Дата:
FAQ