Re: pgbench - allow backslash-continuations in custom scripts

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: pgbench - allow backslash-continuations in custom scripts
Дата
Msg-id alpine.DEB.2.10.1507031342240.16176@sto
обсуждение исходный текст
Ответ на Re: pgbench - allow backslash-continuations in custom scripts  (Andres Freund <andres@anarazel.de>)
Ответы Re: pgbench - allow backslash-continuations in custom scripts  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> I'm pretty clearly in favor of doing correct lexing. I think we should
> generalize that and make it reusable. psql has it's own hacked up
> version already, there seems little point in having variedly good copies
> around.

I must admit that I do not know how to share lexer rules but have 
different actions on them (psql vs sql parser vs ...), as the action code 
is intrinsically intertwined with expressions. Maybe some hack is 
possible. Having yet another SQL-lexer to maintain seems highly 
undesirable, especially just for pgbench.

> I could see including something esimpler, in addition to the lexer, to 
> allow sending multiple statements in one go.

Currently, probably
  SELECT 1; SELECT 1;

Does 2 statements in one go, but it is on one line.

May by allowing both continuations and ";" at the same time:
  -- two statements in one go  SELECT 1; \  SELECT 1;  -- next statement on it's own  SELECT    1;

Which could be reasonnably neat, and easy to implement.

-- 
Fabien.



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Parallel Seq Scan
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [HACKERS] GSoC 2015 proposal: Improve the performance of “ALTER TABLE .. SET LOGGED / UNLOGGED” statement