Re: [HACKERS] Undefined psql variables

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [HACKERS] Undefined psql variables
Дата
Msg-id CAKFQuwYBUgEfsMZbWEyUzxDheNFn6=wx9g7Mq3xAMcGEbyJsxg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Undefined psql variables  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: [HACKERS] Undefined psql variables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jan 23, 2017 at 11:16 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:

[...] Obviously the \if stuff is things we don't have yet either, but it seems less likely to have surprising side-effects.

I agree, a more generic solution seems better than an ad-hoc one.

Currently the value of a non existing psql-variable is... its own reference:-(

  psql> \echo :x
  > :x

I'm not sure of the rational, apart from the probable lexer implementation point of view. Maybe an empty string or 0 or some configurable value would provide better alternative.

​The fundamental problem is that:

SELECT 'testing' AS ":tablename" 

is perfectly valid SQL code.  psql, by design, attempts to resolve all strings of the form <:['"]?\w> in a purely textual manner.

David J.

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] Allowing nonzero return codes from \quit
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: [HACKERS] [PATCH] Add GUCs for predicate lock promotion thresholds