dollar quoting nits - Mailing list pgsql-hackers

From Andrew Dunstan
Subject dollar quoting nits
Date
Msg-id 403B7202.1060802@dunslane.net
Whole thread Raw
Responses Re: dollar quoting nits  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I have 2 small questions.

1. Is there any reason to exclude underscore as the first char of a 
dollar quoting delimiter (after the $), e.g. $_foo_$? I'm happy either 
way, just want to be as liberal as is reasonable.

2. David Fetter asked me the other day if there was any limit on the 
length of the foo inside the $foo$. I glibly told him that I thought 
that we should treat it the same as identifiers, but I have pretty much 
convinced myself that this is wrong. The reason for having limits on 
identifier length is for our convenience, not to protect programmers 
from doing silly things, ISTM. There are places in the code where we put 
names in statically sized buffers etc. with the size set to NAMEDATALEN. 
Changing this would be far more trouble than it is worth, even if it 
were possible. However, none of this applies in the case of $foo$, which 
in fact never makes it outside the lexer at all - the lexer just returns 
the contents as another string. Truncating the delimiter would actually 
make doing sane lexical recognition substantially harder, and Tom's 
original POC patch didn't contain any limit, so I'm intending not to 
place any limit. Does this seem OK?

cheers

andrew




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [pgsql-hackers-win32] Win32 regression test status
Next
From: "scott.marlowe"
Date:
Subject: Re: Sparc optimizations