Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
0eed62f3
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0eed62f3
编写于
1月 15, 2003
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reorder VARCHAR() to appear before CHAR() in docs.
上级
d14c64c4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
53 addition
and
53 deletion
+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
未找到文件。
doc/src/sgml/datatype.sgml
浏览文件 @
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
浏览文件 @
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>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录