Re: massive quotes?

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Jon Jensen <jon(at)endpoint(dot)com>
Cc: Miko O'Sullivan <miko(at)idocs(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: massive quotes?
Date: 2003-09-15 13:48:31
Message-ID: 3F65C32F.10707@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jon Jensen wrote:

>On Sat, 13 Sep 2003, Miko O'Sullivan wrote:
>
>
>
>>jon(at)endpoint(dot)com (Jon Jensen) wrote in message news:<Pine(dot)LNX(dot)4(dot)58(dot)0309111950010(dot)7142(at)louche(dot)swelter(dot)net>...
>>
>>
>>>INSERT INTO sometable (5, <<\.
>>>a
>>>very long
>>>string
>>>\.
>>>);
>>>
>>>
>>I'm delighted to hear that here docs are being discussed for postgres.
>> In the world of Perl here docs make life SO MUCH easier by allowing
>>for independent quoting scopes. Jon, I'm totally in agreement with you
>>that here docs would be a valuable addition to postgres. I'd like to
>>propose a few modifications on the syntax you suggest above.
>>
>>In Perl, the rule for here docs is NOT "it starts immediately after
>>the definition of the terminator" (as in your example). The rule is
>>"it starts on the first line after the end of the command in which the
>>terminator appears". There's a very good reason for this distinction.
>> That reason is that it allows the command to be succinct, usually a
>>single line, and the here doc stays completely separate. So, your
>>example would like this instead:
>>
>> INSERT INTO sometable (5, <<'(END)');
>> a
>> very long
>> string
>> (END)
>>
>>Notice that the entire INSERT command is on one line. Very easy to
>>read.
>>

Well we might also have something like
CREATE FUNCTION ... AS QUOTE('MyEndMarker')
....
all the stuff
... MyEndMarker LANGUAGE 'plpgsql';

This looks quite SQL-like and should be easily implementable. Anyway,
this Perl-like style or Tom's proof-of-concept dollar-quoting one, both
seem equally usable, now let's have someone roll a die to decide.

Regards,
Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2003-09-15 14:32:56 Re: SetQuerySnapshot in 7.4
Previous Message Robert Treat 2003-09-15 13:19:44 Re: massive quotes?