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

Поиск
Список
Период
Сортировка
От tanghy.fnst@fujitsu.com
Тема Remove "FROM" in "DELETE FROM" when using tab-completion
Дата
Msg-id OS0PR01MB61135AE2B07CCD1AB8C6A0F6FB549@OS0PR01MB6113.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответы Re: Remove "FROM" in "DELETE FROM" when using tab-completion
Список pgsql-hackers
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
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Remove "FROM" in "DELETE FROM" when using tab-completion