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: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: massive quotes?
Date: 2003-09-11 16:37:02
Message-ID: 28114.1063298222@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:
> Another idea would be to enable another set of quoting characters, like:

Yeah, I was toying with that also; it would be nearly the same as the
psql literal proposal, but pushed into the backend. I am not sure what
the quoting symbols should look like though. '<--' will not do, it
conflicts with SQL comments.

Another issue that no one has really addressed is that all these
proposals only solve the basic need to double quotes and backslashes in
function bodies. Yes, that would be a huge step forward, but if you
look at the situations where the plpgsql quoting recipe recommends six
or eight or ten quotes in a row, it's still gonna be messy. Seems like
you might want another layer of "special quoting" within plpgsql to aid
in constructing dynamic SQL commands. Can that be handled with the same
notation, or do we need another one? This line of thought suggests that
we might want a convention that supports multiple end-markers, like
shell here-documents do, so that you can nest uses of special quoting.

Perhaps we could do something like this: a special quoted string is
started by a line like
$$FOO
where FOO represents any string of uppercase ASCII letters (we allow
only A-Z here, and nothing else not even whitespace on the line, so
as to minimize the potential for conflicts). Then the string extends
to the first exactly-matching line. This would allow nesting:

$$FOO
...
$$BAR
...
$$BAR
...
$$FOO

I'm not by any means wedded to this particular syntax, but it came to
mind as unlikely to conflict with any existing or planned SQL notations.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-09-11 16:40:47 Re: massive quotes?
Previous Message Andreas Pflug 2003-09-11 16:33:49 Re: massive quotes?