Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ab79444e
Commit
ab79444e
authored
Nov 23, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "(assuming <varname>standard_conforming_strings</> is
<literal>off</>)" clauses for bytea.
parent
5f78aa5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
28 deletions
+31
-28
doc/src/sgml/datatype.sgml
doc/src/sgml/datatype.sgml
+31
-28
No files found.
doc/src/sgml/datatype.sgml
View file @
ab79444e
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.18
0 2006/10/23 18:10:30 petere
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.18
1 2006/11/23 04:27:33 momjian
Exp $ -->
<chapter id="datatype">
<chapter id="datatype">
<title id="datatype-title">Data Types</title>
<title id="datatype-title">Data Types</title>
...
@@ -1097,15 +1097,17 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1097,15 +1097,17 @@ SELECT b, char_length(b) FROM test2;
</para>
</para>
<para>
<para>
When entering <type>bytea</type> values, octets of certain values
When entering <type>bytea</type> values, octets of certain
<emphasis>must</emphasis> be escaped (but all octet values
values <emphasis>must</emphasis> be escaped (but all octet
<emphasis>can</emphasis> be escaped) when used as part of a string
values <emphasis>can</emphasis> be escaped) when used as part
literal in an <acronym>SQL</acronym> statement. In general, to
of a string literal in an <acronym>SQL</acronym> statement. In
escape an octet, it is converted into the three-digit octal number
general, to escape an octet, it is converted into the three-digit
equivalent of its decimal octet value, and preceded by two
octal number equivalent of its decimal octet value, and preceded
backslashes. <xref linkend="datatype-binary-sqlesc"> shows the
by two backslashes (or one backslash if
characters that must be escaped, and gives the alternate escape
<varname>standard_conforming_strings</> is <literal>off</>).
sequences where applicable.
<xref linkend="datatype-binary-sqlesc"> shows the characters
that must be escaped, and gives the alternate escape sequences
where applicable.
</para>
</para>
<table id="datatype-binary-sqlesc">
<table id="datatype-binary-sqlesc">
...
@@ -1168,24 +1170,25 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1168,24 +1170,25 @@ SELECT b, char_length(b) FROM test2;
</para>
</para>
<para>
<para>
The reason that you have to write so many backslashes, as shown in
The reason that you have to write so many backslashes, as shown
<xref linkend="datatype-binary-sqlesc">, is that an input string
in <xref linkend="datatype-binary-sqlesc">, is that an input
written as a string literal must pass through two parse phases in
string written as a string literal must pass through two parse
the <productname>PostgreSQL</productname> server. The first
phases in the <productname>PostgreSQL</productname> server.
backslash of each pair is interpreted as an escape character by
The first backslash of each pair is interpreted as an escape
the string-literal parser and is therefore consumed, leaving the
character by the string-literal parser (assuming
second backslash of the pair. The remaining backslash is then
<varname>standard_conforming_strings</> is <literal>off</>)
recognized by the <type>bytea</type> input function as starting
and is therefore consumed, leaving the second backslash of the
either a three digit octal value or escaping another backslash.
pair. The remaining backslash is then recognized by the
For example, a string literal passed to the server as
<type>bytea</type> input function as starting either a three
<literal>'\\001'</literal> becomes <literal>\001</literal> after
digit octal value or escaping another backslash. For example,
passing through the string-literal parser. The
a string literal passed to the server as <literal>'\\001'</literal>
<literal>\001</literal> is then sent to the <type>bytea</type>
becomes <literal>\001</literal> after passing through the
input function, where it is converted to a single octet with a
string-literal parser. The <literal>\001</literal> is then sent
decimal value of 1. Note that the apostrophe character is not
to the <type>bytea</type> input function, where it is converted
treated specially by <type>bytea</type>, so it follows the normal
to a single octet with a decimal value of 1. Note that the
rules for string literals. (See also <xref
apostrophe character is not treated specially by <type>bytea</type>,
linkend="sql-syntax-strings">.)
so it follows the normal rules for string literals. (See also
<xref linkend="sql-syntax-strings">.)
</para>
</para>
<para>
<para>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment