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
0eed62f3
Commit
0eed62f3
authored
22 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Reorder VARCHAR() to appear before CHAR() in docs.
parent
d14c64c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/src/sgml/datatype.sgml
+47
-48
47 additions, 48 deletions
doc/src/sgml/datatype.sgml
doc/src/sgml/sql.sgml
+6
-5
6 additions, 5 deletions
doc/src/sgml/sql.sgml
with
53 additions
and
53 deletions
doc/src/sgml/datatype.sgml
+
47
−
48
View file @
0eed62f3
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.11
0
200
2/12/06 05:17:42
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.11
1
200
3/01/15 18:01:04
momjian Exp $
-->
<chapter id="datatype">
...
...
@@ -86,18 +86,18 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.110 2002/12/06 05:17:42 m
<entry>binary data</entry>
</row>
<row>
<entry><type>character(<replaceable>n</replaceable>)</type></entry>
<entry><type>char(<replaceable>n</replaceable>)</type></entry>
<entry>fixed-length character string</entry>
</row>
<row>
<entry><type>character varying(<replaceable>n</replaceable>)</type></entry>
<entry><type>varchar(<replaceable>n</replaceable>)</type></entry>
<entry>variable-length character string</entry>
</row>
<row>
<entry><type>character(<replaceable>n</replaceable>)</type></entry>
<entry><type>char(<replaceable>n</replaceable>)</type></entry>
<entry>fixed-length character string</entry>
</row>
<row>
<entry><type>cidr</type></entry>
<entry></entry>
...
...
@@ -248,7 +248,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.110 2002/12/06 05:17:42 m
The following types (or spellings thereof) are specified by
<acronym>SQL</acronym>: <type>bit</type>, <type>bit
varying</type>, <type>boolean</type>, <type>char</type>,
<type>character</type>, <type>character
varying
</type>,
<type>character
varying
</type>, <type>character</type>,
<type>varchar</type>, <type>date</type>, <type>double
precision</type>, <type>integer</type>, <type>interval</type>,
<type>numeric</type>, <type>decimal</type>, <type>real</type>,
...
...
@@ -811,14 +811,14 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
</row>
</thead>
<tbody>
<row>
<entry><type>character(<replaceable>n</>)</type>, <type>char(<replaceable>n</>)</type></entry>
<entry>fixed-length, blank padded</entry>
</row>
<row>
<entry><type>character varying(<replaceable>n</>)</type>, <type>varchar(<replaceable>n</>)</type></entry>
<entry>variable-length with limit</entry>
</row>
<row>
<entry><type>character(<replaceable>n</>)</type>, <type>char(<replaceable>n</>)</type></entry>
<entry>fixed-length, blank padded</entry>
</row>
<row>
<entry><type>text</type></entry>
<entry>variable unlimited length</entry>
...
...
@@ -835,29 +835,29 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
<para>
<acronym>SQL</acronym> defines two primary character types:
<type>character(<replaceable>n</>)</type> and
<type>character
varying
(<replaceable>n</>)</type>, where <replaceable>n</>
is a
positive integer. Both of these types can store strings up to
<type>character
varying
(<replaceable>n</>)</type> and
<type>character
(<replaceable>n</>)</type>, where <replaceable>n</>
is a
positive integer. Both of these types can store strings up to
<replaceable>n</> characters in length. An attempt to store a
longer string into a column of these types will result in an
error, unless the excess characters are all spaces, in which case
the string will be truncated to the maximum length.
(This
somewhat
bizarre exception is required by the
<acronym>SQL</acronym>
standard.)
If the string to be stored is
shorter than the declared length, values of type
<type>character</type> will
be space-padded; values of typ
e
<type>character varying</type> will simply store the
shorter
the string will be truncated to the maximum length. (This
somewhat
bizarre exception is required by the
<acronym>SQL</acronym>
standard.) If the string to be stored is
shorter than the declared
length, values of type <type>character</type> will be space-padded;
values of type
<type>character
varying
</type> will
simply store th
e
shorter
string.
</para>
<note>
<para>
If one explicitly casts a value to
<type>character
(<replaceable>n</>)</type> or
<type>character
varying
(<replaceable>n</>)</type>, then an overlength
value will
be truncated to <replaceable>n</> characters without
raising an
error.
(This too is required by the
<acronym>SQL</acronym>
standard.)
If one explicitly casts a value to
<type>character
varying
(<replaceable>n</>)</type> or
<type>character
(<replaceable>n</>)</type>, then an over
-
length
value will
be truncated to <replaceable>n</> characters without
raising an
error. (This too is required by the
<acronym>SQL</acronym>
standard.)
</para>
</note>
...
...
@@ -870,14 +870,14 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
</note>
<para>
The notations <type>char(<replaceable>n</>)</type> and
<type>
var
char(<replaceable>n</>)</type> are aliases for
<type>character
(<replaceable>n</>)</type> and
<type>character
varying
(<replaceable>n</>)</type>,
respectively.
<type>character</type> without length specifier is
equivalent to
<type>character(1)</type>; if <type>character
varying</type> is used
without length specifier, the type accepts
strings of any size. The
latter is a <productname>PostgreSQL</> extension.
The notations <type>
var
char(<replaceable>n</>)</type> and
<type>char(<replaceable>n</>)</type> are aliases for
<type>character
varying
(<replaceable>n</>)</type> and
<type>character
(<replaceable>n</>)</type>,
respectively.
<type>character</type> without length specifier is
equivalent to
<type>character(1)</type>; if <type>character
varying</type> is used
without length specifier, the type accepts
strings of any size. The
latter is a <productname>PostgreSQL</> extension.
</para>
<para>
...
...
@@ -961,19 +961,18 @@ SELECT b, char_length(b) FROM test2;
<para>
There are two other fixed-length character types in
<productname>PostgreSQL</productname>, shown in <xref linkend="datatype-character-special-table">.
The <type>name</type> type
exists <emphasis>only</emphasis> for storage of internal catalog
names and is not intended for use by the general user. Its length
is currently defined as 64 bytes (63 usable characters plus terminator)
but should be referenced using the constant
<symbol>NAMEDATALEN</symbol>. The length is set at compile time
(and is therefore adjustable for special uses); the default
maximum length may change in a future release. The type
<type>"char"</type> (note the quotes) is different from
<type>char(1)</type> in that it only uses one byte of storage. It
is internally used in the system catalogs as a poor-man's
enumeration type.
<productname>PostgreSQL</productname>, shown in <xref
linkend="datatype-character-special-table">. The <type>name</type>
type exists <emphasis>only</emphasis> for storage of internal
catalog names and is not intended for use by the general user. Its
length is currently defined as 64 bytes (63 usable characters plus
terminator) but should be referenced using the constant
<symbol>NAMEDATALEN</symbol>. The length is set at compile time (and
is therefore adjustable for special uses); the default maximum
length may change in a future release. The type <type>"char"</type>
(note the quotes) is different from <type>char(1)</type> in that it
only uses one byte of storage. It is internally used in the system
catalogs as a poor-man's enumeration type.
</para>
<table id="datatype-character-special-table">
...
...
This diff is collapsed.
Click to expand it.
doc/src/sgml/sql.sgml
+
6
−
5
View file @
0eed62f3
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.2
7
200
2
/0
8/28 14:35:36
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.2
8
200
3
/0
1/15 18:01:05
momjian Exp $
-->
<chapter id="sql">
...
...
@@ -1749,19 +1749,20 @@ CREATE TABLE SELLS
<listitem>
<para>
CHAR(<replaceable class="parameter">n</replaceable>):
fixed
length character string of length
VAR
CHAR(<replaceable class="parameter">n</replaceable>):
varying
length character string of
maximum
length
<replaceable class="parameter">n</replaceable>.
</para>
</listitem>
<listitem>
<para>
VAR
CHAR(<replaceable class="parameter">n</replaceable>):
varying
length character string of
maximum
length
CHAR(<replaceable class="parameter">n</replaceable>):
fixed
length character string of length
<replaceable class="parameter">n</replaceable>.
</para>
</listitem>
</itemizedlist>
</para>
</sect3>
...
...
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