Re: Allowing line-continuation in pgbench custom scripts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Allowing line-continuation in pgbench custom scripts
Дата
Msg-id 26629.1401119523@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Allowing line-continuation in pgbench custom scripts  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Allowing line-continuation in pgbench custom scripts
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Amit Langote wrote:
>> On Mon, May 26, 2014 at 10:59 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>>> IMO it's better if we can write SQL in multiples line *without* a tailing
>>> escape character, like psql's input file.

>> Yeah, that would be much cleaner.

> But that would require duplicating the lexing stuff to determine where
> quotes are and where commands end.  There are already some cases where
> pgbench itself is the bottleneck; adding a lexing step would be more
> expensive, no?  Whereas simply detecting line continuations would be
> cheaper.

Well, we only parse the script file(s) once at run start, and that time
isn't included in the TPS timing, so I don't think performance is really
an issue here.  But yeah, the amount of code that would have to be
duplicated out of psql is pretty daunting --- it'd be a maintenance
nightmare, for what seems like not a lot of gain.  There would also
be a compatibility issue if we went this way, because existing scripts
that haven't bothered with semicolon line terminators would break.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Allowing line-continuation in pgbench custom scripts
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Priority table or Cache table