Re: [PATCHES] dollar quoting - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [PATCHES] dollar quoting
Date
Msg-id 4027311E.9090907@dunslane.net
Whole thread Raw
In response to Re: [PATCHES] dollar quoting  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:

>A bigger problem here:
>
>
>
>>+             else if (!dol_quote && line[i] == '$' &&
>>+                      !isdigit(line[i + thislen]) &&
>>+                      (dol_end = strchr(line+i+1,'$')) != NULL &&
>>+                      (i == 0 ||
>>+                       ! ((line[i-1] & 0x80) != 0 || isalnum(line[i-1]) ||
>>+                          line[i-1] == '_')))
>>+             {
>>
>>
>
>is that you aren't checking that what comes between the two dollar signs
>looks like empty-or-an-identifier.  The check for
>next-char-isn't-a-digit is part of that but not the only part.
>
>


Well, I think the right way to do a full check would be with a regex,
which I had hoped to avoid. However, I will now try to get one working
and to address your other concerns.

Thanks for the comments.

cheers

andrew


pgsql-hackers by date:

Previous
From: "Alex J. Avriette"
Date:
Subject: Re: RFC: Very large scale postgres support
Next
From: Neil Conway
Date:
Subject: Re: psql variables