Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
22e22a52
Commit
22e22a52
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Spelling and grammatical corrections.
parent
49d762f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/datatype.sgml
+16
-25
16 additions, 25 deletions
doc/src/sgml/datatype.sgml
with
16 additions
and
25 deletions
doc/src/sgml/datatype.sgml
+
16
−
25
View file @
22e22a52
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.7
4
2001/11/21
05:53:40 thomas
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.7
5
2001/11/21
21:12:34 tgl
Exp $
-->
-->
<chapter id="datatype">
<chapter id="datatype">
...
@@ -1005,10 +1005,9 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1005,10 +1005,9 @@ SELECT b, char_length(b) FROM test2;
octet values <emphasis>may</emphasis> be escaped) when used as part of
octet values <emphasis>may</emphasis> be escaped) when used as part of
a string literal in an <acronym>SQL</acronym> statement. In general,
a string literal in an <acronym>SQL</acronym> statement. In general,
to escape an octet, it is converted into the three digit octal number
to escape an octet, it is converted into the three digit octal number
equivalent of its decimal octet value, and preceeded by two
equivalent of its decimal octet value, and preceded by two
backslashes. Octets with the decimal values 39 (single quote), and 92
backslashes. Some octet values have alternate escape sequences, as
(backslash), have special alternate escape sequences. Details are in
shown in <xref linkend="datatype-binary-sqlesc">.
<xref linkend="datatype-binary-sqlesc">.
</para>
</para>
<table id="datatype-binary-sqlesc">
<table id="datatype-binary-sqlesc">
...
@@ -1059,7 +1058,7 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1059,7 +1058,7 @@ SELECT b, char_length(b) FROM test2;
octet and backslash are more than one character. <type>Bytea</type>
octet and backslash are more than one character. <type>Bytea</type>
output octets are also escaped. In general, each
output octets are also escaped. In general, each
<quote>non-printable</quote> octet decimal value is converted into
<quote>non-printable</quote> octet decimal value is converted into
its equivalent three digit octal value, and prece
e
ded by one backslash.
its equivalent three digit octal value, and preceded by one backslash.
Most <quote>printable</quote> octets are represented by their standard
Most <quote>printable</quote> octets are represented by their standard
representation in the client character set. The octet with decimal
representation in the client character set. The octet with decimal
value 92 (backslash) has a special alternate output representation.
value 92 (backslash) has a special alternate output representation.
...
@@ -1081,14 +1080,6 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1081,14 +1080,6 @@ SELECT b, char_length(b) FROM test2;
<tbody>
<tbody>
<row>
<entry> <literal> 39 </literal> </entry>
<entry> single quote </entry>
<entry> <literal> ' </literal> </entry>
<entry> <literal> select '\\047'::bytea; </literal></entry>
<entry> <literal> ' </literal></entry>
</row>
<row>
<row>
<entry> <literal> 92 </literal> </entry>
<entry> <literal> 92 </literal> </entry>
<entry> backslash </entry>
<entry> backslash </entry>
...
@@ -1108,7 +1099,7 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1108,7 +1099,7 @@ SELECT b, char_length(b) FROM test2;
<row>
<row>
<entry> <literal> 32 to 126 </literal> </entry>
<entry> <literal> 32 to 126 </literal> </entry>
<entry> <quote>printable</quote> octets </entry>
<entry> <quote>printable</quote> octets </entry>
<entry>
client character set
representation </entry>
<entry>
ASCII
representation </entry>
<entry> <literal> select '\\176'::bytea; </literal> </entry>
<entry> <literal> select '\\176'::bytea; </literal> </entry>
<entry> <literal> ~ </literal></entry>
<entry> <literal> ~ </literal></entry>
</row>
</row>
...
@@ -1119,12 +1110,12 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1119,12 +1110,12 @@ SELECT b, char_length(b) FROM test2;
<para>
<para>
<acronym>SQL</acronym> string literals (input strings) must be
<acronym>SQL</acronym> string literals (input strings) must be
prece
e
ded with two backslashes due to the fact that they must pass
preceded with two backslashes due to the fact that they must pass
through two parsers in the PostgreSQL backend. The first backslash
through two parsers in the PostgreSQL backend. The first backslash
is interpreted as an escape character by the string literal parser,
is interpreted as an escape character by the string literal parser,
and therefore is consumed, leaving the octets that follow.
and therefore is consumed, leaving the octets that follow.
The
second
backslash is recognized by <type>bytea</type> input
function
The
remaining
backslash is recognized by
the
<type>bytea</type> input
as the prefix of a three digit octal value. For example, a string
function
as the prefix of a three digit octal value. For example, a string
literal passed to the backend as <literal>'\\001'</literal> becomes
literal passed to the backend as <literal>'\\001'</literal> becomes
<literal>'\001'</literal> after passing through the string literal
<literal>'\001'</literal> after passing through the string literal
parser. The <literal>'\001'</literal> is then sent to the
parser. The <literal>'\001'</literal> is then sent to the
...
@@ -1135,11 +1126,11 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1135,11 +1126,11 @@ SELECT b, char_length(b) FROM test2;
<para>
<para>
For a similar reason, a backslash must be input as
For a similar reason, a backslash must be input as
<literal>'\\\\'</literal> (or <literal>'\\134'</literal>). The first
<literal>'\\\\'</literal> (or <literal>'\\134'</literal>). The first
and third backslashes are interpreted as escape
o
cte
t
s by the
and third backslashes are interpreted as escape
chara
cte
r
s by the
string literal parser, and therefore are consumed, leaving t
he
string literal parser, and therefore are consumed, leaving t
wo
second and forth backslashes untouched. The second and forth
backslashes in the string passed to the <type>bytea</type> input function,
backslashes are recognized by the <type>bytea</type> input function
which interprets them as representing a single backslash.
as a single backslash.
For example, a string literal passed to the
For example, a string literal passed to the
backend as <literal>'\\\\'</literal> becomes <literal>'\\'</literal>
backend as <literal>'\\\\'</literal> becomes <literal>'\\'</literal>
after passing through the string literal parser. The
after passing through the string literal parser. The
<literal>'\\'</literal> is then sent to the <type>bytea</type> input
<literal>'\\'</literal> is then sent to the <type>bytea</type> input
...
@@ -1169,7 +1160,7 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1169,7 +1160,7 @@ SELECT b, char_length(b) FROM test2;
line feeds and carriage returns if your interface automatically
line feeds and carriage returns if your interface automatically
translates these. Or you may have to double up on backslashes if
translates these. Or you may have to double up on backslashes if
the parser for your language or choice also treats them as an
the parser for your language or choice also treats them as an
escape
o
cte
t
.
escape
chara
cte
r
.
</para>
</para>
<sect2 id="datatype-binary-compat">
<sect2 id="datatype-binary-compat">
...
@@ -1246,7 +1237,7 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1246,7 +1237,7 @@ SELECT b, char_length(b) FROM test2;
<row>
<row>
<entry> A binary string literal is comprised of an even number of
<entry> A binary string literal is comprised of an even number of
hex
i
decimal digits, in single quotes, prece
e
ded by <quote>X</quote>,
hex
a
decimal digits, in single quotes, preceded by <quote>X</quote>,
e.g. <literal>X'1a43fe'</literal></entry>
e.g. <literal>X'1a43fe'</literal></entry>
<entry> A binary string literal is comprised of octets
<entry> A binary string literal is comprised of octets
escaped according to the rules shown in
escaped according to the rules shown in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment