Re: pgbench - allow backslash continuations in \set expressions

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: pgbench - allow backslash continuations in \set expressions
Дата
Msg-id alpine.DEB.2.20.1611302335520.20436@lancre
обсуждение исходный текст
Ответ на Re: pgbench - allow backslash continuations in \set expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgbench - allow backslash continuations in \set expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello Tom,

> In short, I want to mark this RWF for today and ask for a version that
> applies globally to all backslash commands in psql and pgbench.

Hmmm.

The modus operandi of backslash command scanning is to switch to possibly 
another scanner just after scanning the backslash command, so I did the 
simple thing which is to handle this in the expression scanner. A simple 
feature achieved with a simple code.

Factoring out the behavior means handling continuations from the master 
scanner, probably by using some other intermediate buffer which is then 
rescanned...

This implies that all backslash commands share some kind of minimal 
lexical convention that \ followed by a (\r|\n|\r\n) is a continuation...

But then what if the backslash command accept quoted strings, should a 
continuation still be a continuation inside quotes? If not, how do I know? 
Are all currently existing backslash command compatible with a common set 
of lexical convention? Or do some commands should accept backslash 
continuations and others not, and have to be treated differently and 
knowingly by the lexer?

There is also the issue of locating error messages if the continuation is 
in another buffer, probably someone will complain.

Basically, many issues arise, all of them somehow solvable, but I'm afraid 
with many more lines than my essentially one line patch:-)

I'm not sure such a simple feature deserves so much energy.

-- 
Fabien.



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Add support for restrictive RLS policies
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgbench - allow backslash continuations in \set expressions