diff options
author | Bruce Momjian <bruce@momjian.us> | 2018-09-21 19:55:06 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2018-09-21 19:55:06 -0400 |
commit | ed6755bae23b4958ce706d8b027eb8284be8e2d3 (patch) | |
tree | bdd8224ba95a37691855825a98f0d46e114ecec6 /doc/src/sgml/array.sgml | |
parent | dbbc98a9ef67b350caf1bf02ad549f238853faed (diff) | |
download | postgresql-ed6755bae23b4958ce706d8b027eb8284be8e2d3.tar.gz postgresql-ed6755bae23b4958ce706d8b027eb8284be8e2d3.zip |
docs: remove use of escape strings and use bytea hex output
standard_conforming_strings defaulted to 'on' in PG 9.1.
bytea_output defaulted to 'hex' in PG 9.0.
Reported-by: André Hänsel
Discussion: https://postgr.es/m/12e601d447ac$345994a0$9d0cbde0$@webkr.de
Backpatch-through: 9.3
Diffstat (limited to 'doc/src/sgml/array.sgml')
-rw-r--r-- | doc/src/sgml/array.sgml | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/doc/src/sgml/array.sgml b/doc/src/sgml/array.sgml index 4385a09cd97..081ba929988 100644 --- a/doc/src/sgml/array.sgml +++ b/doc/src/sgml/array.sgml @@ -740,9 +740,9 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2 For example, elements containing curly braces, commas (or the data type's delimiter character), double quotes, backslashes, or leading or trailing whitespace must be double-quoted. Empty strings and strings matching the - word <literal>NULL</> must be quoted, too. To put a double quote or - backslash in a quoted array element value, use escape string syntax - and precede it with a backslash. Alternatively, you can avoid quotes and use + word <literal>NULL</literal> must be quoted, too. To put a double + quote or backslash in a quoted array element value, precede it + with a backslash. Alternatively, you can avoid quotes and use backslash-escaping to protect all data characters that would otherwise be taken as array syntax. </para> @@ -755,27 +755,6 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2 non-whitespace characters of an element, is not ignored. </para> - <note> - <para> - Remember that what you write in an SQL command will first be interpreted - as a string literal, and then as an array. This doubles the number of - backslashes you need. For example, to insert a <type>text</> array - value containing a backslash and a double quote, you'd need to write: -<programlisting> -INSERT ... VALUES (E'{"\\\\","\\""}'); -</programlisting> - The escape string processor removes one level of backslashes, so that - what arrives at the array-value parser looks like <literal>{"\\","\""}</>. - In turn, the strings fed to the <type>text</> data type's input routine - become <literal>\</> and <literal>"</> respectively. (If we were working - with a data type whose input routine also treated backslashes specially, - <type>bytea</> for example, we might need as many as eight backslashes - in the command to get one backslash into the stored array element.) - Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting">) can be - used to avoid the need to double backslashes. - </para> - </note> - <tip> <para> The <literal>ARRAY</> constructor syntax (see |