diff options
| author | Bruce Momjian <bruce@momjian.us> | 2007-01-30 22:29:23 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2007-01-30 22:29:23 +0000 |
| commit | 4ed9f1d9b776677ad26cd352dbc0810d7bed6a8f (patch) | |
| tree | 584180f09ff14fb6ba1d32f4f6450ced77911955 /doc/src/sgml/plpgsql.sgml | |
| parent | 35b039a26ca2cdcfae94c5aacd0ac4a0904b5285 (diff) | |
Update documentation for backslashes to mention escape string syntax
more, and standard_conforming_strings less, because in the future non-E
strings will not treat backslashes specially.
Also use E'' strings where backslashes are used in examples. (The
existing examples would have drawn warnings.)
Backpatch to 8.2.X.
Diffstat (limited to 'doc/src/sgml/plpgsql.sgml')
| -rw-r--r-- | doc/src/sgml/plpgsql.sgml | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index ec276abb826..7eea925512c 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.102 2006/12/26 16:14:58 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.103 2007/01/30 22:29:23 momjian Exp $ --> <chapter id="plpgsql"> <title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title> @@ -288,7 +288,8 @@ $$ LANGUAGE plpgsql; <command>CREATE FUNCTION</command> as a string literal. If you write the string literal in the ordinary way with surrounding single quotes, then any single quotes inside the function body - must be doubled; likewise any backslashes must be doubled. + must be doubled; likewise any backslashes must be doubled (assuming + escape string syntax is used). Doubling quotes is at best tedious, and in more complicated cases the code can become downright incomprehensible, because you can easily find yourself needing half a dozen or more adjacent quote marks. @@ -434,13 +435,6 @@ a_output := a_output || $$ if v_$$ || referrer_keys.kind || $$ like '$$ </varlistentry> </variablelist> - <para> - A variant approach is to escape quotation marks in the function body - with a backslash rather than by doubling them. With this method - you'll find yourself writing things like <literal>\'\'</> instead - of <literal>''''</>. Some find this easier to keep track of, some - do not. - </para> </sect2> </sect1> |
