Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Andrew Dunstan
Philip Warner wrote: At 01:07 PM 12/08/2004, Andrew Dunstan wrote: \ is not magical inside dollar quotes, Sorry, I was confused by the manual: the paragraph that starts "C-style backslash escapes are also available..." is right after the paragraphs on dollar-quoting. The section on dollar-quot

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > At 01:07 PM 12/08/2004, Andrew Dunstan wrote: >> \ is not magical inside dollar quotes, > Sorry, I was confused by the manual: the paragraph that starts "C-style > backslash escapes are also available..." is right after the paragraphs on > dollar-quoti

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > At 12:47 PM 12/08/2004, Tom Lane wrote: >> Backslashes are not special inside >> dollar quotes --- nor is anything else, except the matching close tag > If they are not special, then shouldnt: > select $a$\$a$; > result in > ?column? >\ >

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Philip Warner
At 01:07 PM 12/08/2004, Andrew Dunstan wrote: \ is not magical inside dollar quotes, Sorry, I was confused by the manual: the paragraph that starts "C-style backslash escapes are also available..." is right after the paragraphs on dollar-quoting. The section on dollar-quoting is also not explici

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Andrew Dunstan
Philip Warner wrote: While trying to understand dollar-quoting, I found the following in psql: select $a$ hello $a$; behaves as expected, but psql does not like select $a$ \ $a$; or select $a$ \\ $a$; Should it? How should a dollar-quote handle: $a$ \$a\$a $a$ ? andrew=# select $a$ \

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Philip Warner
At 12:47 PM 12/08/2004, Tom Lane wrote: Backslashes are not special inside dollar quotes --- nor is anything else, except the matching close tag If they are not special, then shouldnt: select $a$\$a$; result in ?column? \ rather than an error? Oops. It does. --

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Philip Warner
At 12:47 PM 12/08/2004, Tom Lane wrote: Backslashes are not special inside dollar quotes --- nor is anything else, except the matching close tag If they are not special, then shouldnt: select $a$\$a$; result in ?column? \ rather than an error? --

Re: [HACKERS] dollar-quoting in psql and in general

2004-08-11 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > While trying to understand dollar-quoting, I found the following in psql: > select $a$ hello $a$; > behaves as expected, but psql does not like > select $a$ \ $a$; > or > select $a$ \\ $a$; Define "does not like". The behavior seems correc

Re: [HACKERS] dollar quoting

2004-05-10 Thread Andrew Dunstan
Andrew Dunstan wrote: Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> 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 quo

Re: [HACKERS] dollar quoting and pg_dump

2004-03-23 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > Does it _have_ to be dollars? Other languages call this feature > 'heretext' IIRC. I'm not in love with the name "dollar quoting" either ... but "here text" would be quite misleading. See the archives for the discussions that led us to devel

Re: [HACKERS] dollar quoting and pg_dump

2004-03-23 Thread Jon Jensen
On Wed, 24 Mar 2004, Christopher Kings-Lynne wrote: > > I don't mind if it's on by default; just thinking that some people might > > appreciate a way to turn it off. "-X disable-dollar-quoting" sounds > > fine. > > Does it _have_ to be dollars? Other languages call this feature > 'heretext' II

Re: [HACKERS] dollar quoting and pg_dump

2004-03-23 Thread Andrew Dunstan
Christopher Kings-Lynne wrote: I don't mind if it's on by default; just thinking that some people might appreciate a way to turn it off. "-X disable-dollar-quoting" sounds fine. Does it _have_ to be dollars? Other languages call this feature 'heretext' IIRC. This is not heretext, and calli

Re: [HACKERS] dollar quoting and pg_dump

2004-03-23 Thread Christopher Kings-Lynne
I don't mind if it's on by default; just thinking that some people might appreciate a way to turn it off. "-X disable-dollar-quoting" sounds fine. Does it _have_ to be dollars? Other languages call this feature 'heretext' IIRC. Chris ---(end of broadcast)---

Re: [HACKERS] dollar quoting and pg_dump

2004-03-23 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> A thought: maybe just put this logic into the regular >> appendStringLiteral routine, and trigger it when the string contains any >> quotes or backslashes; if it has none, you can just use quotes ... > I did think of fallback, but rej

Re: [HACKERS] dollar quoting and pg_dump

2004-03-23 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > ... using it in dumping function bodies and comments on all objects, > with a prefix argument of "function" and "comment" respectively. There > might be other places where we want to use dollar quoting, but this > would be a good start, ISTM. Do we r

Re: [HACKERS] dollar quoting nits

2004-02-24 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > 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. I think we had agreed to "same rules as identifiers, excep

Re: [HACKERS] dollar quoting

2004-02-07 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> 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 b

Re: [HACKERS] dollar quoting

2004-02-07 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> 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 iden

Re: [HACKERS] dollar quoting

2004-02-07 Thread Andrew Dunstan
Andrew Dunstan wrote: Tom Lane wrote: I kinda thought you had volunteered to work on the psql part... I don't recall being that specific, but you could be right. In any case, I didn't want to trip over anyone else, which is why I asked. I will try to coordinate with Jon. After starin

Re: [HACKERS] dollar quoting

2004-02-05 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: IIRC, a consensus was reached on the actual format of the quote delimiters (either $$ or $identifier$), and Tom had a proof of concept patch to the parser to handle it, but work was needed on psql, plpgsql, pg_dump (and pg_restore?

Re: [HACKERS] dollar quoting

2004-02-05 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > IIRC, a consensus was reached on the actual format of the quote > delimiters (either $$ or $identifier$), and Tom had a proof of concept > patch to the parser to handle it, but work was needed on psql, plpgsql, > pg_dump (and pg_restore?) + docs. I t

Re: [HACKERS] dollar quoting

2004-02-05 Thread Jon Jensen
On Thu, 5 Feb 2004, Andrew Dunstan wrote: > What has become of the "dollar quoting" mechanism that we had so much > discussion about back in August/September? > > IIRC, a consensus was reached on the actual format of the quote > delimiters (either $$ or $identifier$), and Tom had a proof of con