Re: [HACKERS] IF (NOT) EXISTS in psql-completion

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] IF (NOT) EXISTS in psql-completion
Дата
Msg-id 1322.1488157943@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] IF (NOT) EXISTS in psql-completion  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [HACKERS] IF (NOT) EXISTS in psql-completion  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> On Mon, Feb 27, 2017 at 5:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> So I'd be a whole lot happier if it didn't do that.  Can we really not
>> add the desired features in a more localized fashion?

> As "if not exists" is defined after the object type if would not be
> that complicated to add completion for IE/INE after the object type
> with a set of THING_* flags in words_after_create. One missing piece
> would be to add completion for the objects themselves after IE or INE
> have been entered by the user, but I would think that tweaking the
> checks on words_after_create[i] would be doable as well. And that
> would be localized.

BTW ... can anyone explain to me the reason why we offer to complete
CREATE OBJECT with the names of existing objects of that kind?
That seems pretty darn stupid.  I can see offering the names of existing
schemas there, if the object type is one that has schema-qualified names,
but completing with an existing object name is just setting up to fail
isn't it?

If we dropped that behavior, seems like it would become much easier
to plug in IF NOT EXISTS at those spots.
        regards, tom lane



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Proposal for changes to recovery.conf API
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] IF (NOT) EXISTS in psql-completion