Re: Two small patches for the isolationtester lexer

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Two small patches for the isolationtester lexer
Date: 2018-02-27 07:51:41
Message-ID: 75485E60-C4A3-4C01-A821-444108E73F8A@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 22 Feb 2018, at 05:10, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> I wrote;
>> Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>>> I also (again) forgot about the # comments not being allowed inside setup and
>>> teardown blocks, so patch 0002 proposes adding support for these as the
>>> documentation implies.
>
>> Hmm, not sure this is a good idea. # is a valid SQL operator name, so
>> doing this would create some risk of breaking legal queries.
>
> Actually, looking closer, this would also trigger on '#' used inside a
> SQL literal, which seems to move the problem cases into the "pretty
> likely" category instead of the "far-fetched" one. So I'd only be OK
> with it if we made the lexer smart enough to distinguish inside-a-SQL-
> literal from not. That might be a good thing anyway, since it would
> allow us to not choke on literals containing '}', but it'd be a great
> deal more work. You might be able to steal code from the psql lexer
> though.

I agree, patch 0002 was broken and the correct fix is a much bigger project -
one too big for me to tackle right now (but hopefully at some point in the near
future). Thanks for the review of it though!

cheers ./daniel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-02-27 09:17:00 Re: Scenario using pg_rewind
Previous Message Daniel Gustafsson 2018-02-27 07:47:22 Re: Two small patches for the isolationtester lexer