Re: dollar quoting

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dollar quoting
Date: 2004-02-08 00:45:57
Message-ID: 402586C5.3030902@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>
>>After staring at the code for a long time, I think I see how to do this.
>>It's complicated a bit by the fact that $ is a valid identifier
>>character. So my current thinking is to say that if we see $ not in a
>>quote and not preceded by a valid identifier char then it is the start
>>of a $foo$ sequence. Or have I missed something? Can we validly see $ in
>>any other context?
>>
>>
>
>Right, a $ should be considered to start a quote marker only if it's not
>part of an identifier. The backend lexer doesn't have a problem with
>this because it's written in flex, but I can imagine that getting it
>right in psql's ad-hoc parser might be tricky.
>

I think it's doable, though. I seem to have a working patch, which I
will send out for review soon.

>
>There was some discussion awhile back of converting psql to use flex
>for interpreting its input, but I dunno how practical that really is.
>I don't know how you get flex to do reasonable stuff with an incomplete
>input string. Still, it might be worth looking into.
>
>
>

That's what made me not even think about it. If someone better versed in
this stuff than me wants to do it then more power to them.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-02-08 00:50:11 Re: PITR Dead horse?
Previous Message Bruce Momjian 2004-02-08 00:45:18 Re: PITR Dead horse?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-02-08 01:38:24 Re: Two-phase commit
Previous Message Tom Lane 2004-02-07 21:51:02 Re: dollar quoting