Re: massive quotes?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: massive quotes?
Дата
Msg-id 1696.1063315714@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: massive quotes?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: massive quotes?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: massive quotes?  (Sean Chittenden <sean@chittenden.org>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.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
$$FUNCTIONBODYtext here$$FUNCTIONBODY
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: massive quotes?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: massive quotes?