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
0eed62f3
Commit
0eed62f3
authored
Jan 15, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder VARCHAR() to appear before CHAR() in docs.
parent
d14c64c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
53 deletions
+53
-53
doc/src/sgml/datatype.sgml
doc/src/sgml/datatype.sgml
+47
-48
doc/src/sgml/sql.sgml
doc/src/sgml/sql.sgml
+6
-5
No files found.
doc/src/sgml/datatype.sgml
View file @
0eed62f3
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.11
0 2002/12/06 05:17:42
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.11
1 2003/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>characte
r
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> o
r
<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>
varchar(<replaceable>n</>)</type> are aliases fo
r
<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>characte
r
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">
...
...
doc/src/sgml/sql.sgml
View file @
0eed62f3
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.2
7 2002/08/28 14:35:36
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.2
8 2003/01/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>
...
...
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