8. Data Types

Chapter 8. Data Types
第八章.数据类型
PostgreSQL has a rich set of native data types available to users. Users can add new types to PostgreSQL using the CREATE TYPE command.
PostgreSQL有丰富的原生支持的数据类型。用户也可以使用 CREATE TYPE命令自定义数据类型。
 
Table 8.1 shows all the built-in general-purpose data types. Most of the alternative names listed in the “Aliases” column are the names used internally by PostgreSQL for historical reasons. In addition,some internally used or deprecated types are available, but are not listed here.
表8.1中为内置支持的数据类型。在ALIASES列中列出的名字,大部分都是出于历史原因而被PostgreSQL内部使用的。 此外,还提供了一些内部使用或不推荐使用的类型,但此处未列出。
 
 
 
Compatibility
兼容性
The following types (or spellings thereof) are specified by SQL: bigintbitbit varyingbooleancharcharacter varyingcharactervarchar,datedouble precisionintegerintervalnumericdecimalreal,smallinttime (with or without time zone), timestamp (with or without time zone), xml.
SQL指定了以下类型(或其拼写):bigint, bit, bit varying, boolean, char, character varying, character, varchar,date, double precision, integer, interval, numeric, decimal, real,smallint, time (带或不带时区), timestamp (带或不带时区), xml.
 
Each data type has an external representation determined by its input and output functions. Many of the built-in types have obvious external formats. However, several types are either unique to PostgreSQL,such as geometric paths, or have several possible formats, such as the date and time types. Some of the input and output functions are not invertible, i.e., the result of an output function might lose accuracy when compared to the original input.
每种数据类型都有一个由其输入和输出函数确定的外部表示形式。许多内置类型具有明显的外部格式。但是,有几种类型对于PostgreSQL是唯一的,例如几何路径,或者有几种可能的格式,例如日期和时间类型。一些输入和输出函数不可逆,即,与原始输入相比,输出函数的结果可能会失去准确性。
发布了341 篇原创文章 · 获赞 54 · 访问量 88万+

猜你喜欢

转载自blog.csdn.net/ghostliming/article/details/104589025