Re: massive quotes?

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: massive quotes?
Date: 2003-09-11 16:33:49
Message-ID: 3F60A3ED.8000403@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:

>Tom Lane wrote:
>
>
>>The discussion so far today seems to be entirely a rehash of arguments
>>already made (and in many cases already rebutted). Rather than wasting
>>list bandwidth with this, I think each camp ought to go off and do their
>>homework. Give us *details* of how your solution would work.
>>
>>
>
>Another idea would be to enable another set of quoting characters, like:
>
> CREATE FUNCTION xx ...
> <--
> x = 'fred';
> ...
> -->
>
>and have the lexer understand those new quoting characters. We just use
>'' too much in function bodies to use that also for quoting the function
>text. Of course, '<--' would have no special meaning inside a quoted
>string, so we are only eliminating their use as custom operators, and I
>think that is reasonable.
>
>Having heard all the other proposals, I think this will be the clearest.
>
>
>
This looks quite similar to my proposal. I called it "function body is
enclosed in keywords", while Bruce will enclose it in new quote strings.
This is obviously very different for the lexer/parser, while identical
for the user. Sounds good to me.
The quoting strings seem a bit suspicious to me, I can imagine comments
like this "converting abc --> def", which would certainly break the
function definition (I scanned a part of my sources, I found two
occurrences of "-->", one of them in SQL code...)

How about quoting strings that look like keywords, e.g. FUNCTIONBODY and
ENDFUNCTIONBODY?

CREATE FUNCTION foo() RETURNS int4 AS
FUNCTIONBODY
DECLARE bar int4;
BEGIN
RETURN bar;
END;
ENDFUNCTIONBODY
LANGUAGE 'plpgsql';

Regards,
Andreas

Regards,
Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-11 16:37:02 Re: massive quotes?
Previous Message Darko Prenosil 2003-09-11 16:31:14 Re: Vote: Adding flex/bison derived files in WIN32_DEV