Re: massive quotes?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Jon Jensen <jon(at)endpoint(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: massive quotes?
Date: 2003-09-11 21:28:34
Message-ID: 1696.1063315714@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> The $$FOO proposal I put forward earlier was consciously modeled on
>> here-documents.

> Couldn't we allow << at the beginning of the line to mean 'here' document?

No; you could easily be breaking existing queries, for example

regression=# select f1, f1 << 8 from int4_tbl;
f1 | ?column?
-------------+-----------
0 | 0
123456 | 31604736
-123456 | -31604736
2147483647 | -256
-2147483647 | 256
(5 rows)

is only one unfortunate choice of line break away from being eaten by
such a proposal.

I suggested $$ because AFAIK we don't currently have any valid syntax
that would allow that to appear at the start of a line (it helps a great
deal that we just removed $ from the set of characters allowed in
operators ;-)). If you consider my $$FOO proposal to include the
possibility of a zero-length FOO string, then the shortest legal
alternative would be

$$
string contents here
$$

but adding a string to that reduces the odds of conflict (especially
when you consider languages like plperl; IIRC, $$ is something or other
useful in Perl). Also you can use mnemonically-chosen strings; maybe
Andreas will like

$$FUNCTIONBODY
text here
$$FUNCTIONBODY

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-09-11 21:28:52 Re: massive quotes?
Previous Message Jan Wieck 2003-09-11 21:25:24 Re: massive quotes?