diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-04-19 18:52:58 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-04-19 18:52:58 +0000 |
| commit | 3a624e9200bbd8b88d7724e1448fe530f32e2c3c (patch) | |
| tree | 1b540115b0ae55108784c32d7bd1473f10312657 /doc/src | |
| parent | 7f2f798b30b53dc24bee78ec4e1f3c2d0d987de0 (diff) | |
| download | postgresql-3a624e9200bbd8b88d7724e1448fe530f32e2c3c.tar.gz | |
Revise plpgsql's scanner to process comments and string literals in a way
more nearly matching the core SQL scanner. The user-visible effects are:
* Block comments (slash-star comments) now nest, as per SQL spec.
* In standard_conforming_strings mode, backslash as the last character of a
non-E string literal is now correctly taken as an ordinary character;
formerly it was misinterpreted as escaping the ending quote. (Since the
string also had to pass through the core scanner, this invariably led
to syntax errors.)
* Formerly, backslashes in the format string of RAISE were always treated as
quoting the next character, regardless of mode. Now, they are ordinary
characters with standard_conforming_strings on, while with it off, they
introduce the same set of escapes as in the core SQL scanner. Also,
escape_string_warning is now effective for RAISE format strings. These
changes make RAISE format strings work just like any other string literal.
This is implemented by copying and pasting a lot of logic from the core
scanner. It would be a good idea to look into getting rid of plpgsql's
scanner entirely in favor of using the core scanner. However, that involves
more change than I can justify making during beta --- in particular, the core
scanner would have to become re-entrant.
In passing, remove the kluge that made the plpgsql scanner emit T_FUNCTION or
T_TRIGGER as a made-up first token. That presumably had some value once upon
a time, but now it's just useless complication for both the scanner and the
grammar.
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/plpgsql.sgml | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 6eb9b2b9e7..319547ec00 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.139 2009/04/02 19:20:45 momjian Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.140 2009/04/19 18:52:56 tgl Exp $ --> <chapter id="plpgsql"> <title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title> @@ -220,10 +220,8 @@ END <optional> <replaceable>label</replaceable> </optional>; There are two types of comments in <application>PL/pgSQL</>. A double dash (<literal>--</literal>) starts a comment that extends to the end of the line. A <literal>/*</literal> starts a block comment that extends to - the next occurrence of <literal>*/</literal>. Block comments cannot be - nested, but double dash comments can be enclosed into a block comment and - a double dash can hide the block comment delimiters <literal>/*</literal> - and <literal>*/</literal>. + the next occurrence of <literal>*/</literal>. Block comments nest, + just as in ordinary SQL. </para> <para> |
