Postgresql 中文操作指南

Chapter 10. Type Conversion

Table of Contents

SQL 语句可能有意或无意地要求在同一个表达式中混合不同的数据类型。PostgreSQL 有广泛的机制来评估混合类型表达式。

SQL statements can, intentionally or not, require the mixing of different data types in the same expression. PostgreSQL has extensive facilities for evaluating mixed-type expressions.

在许多情况下,用户无需理解类型转换机制的细节。不过,PostgreSQL 执行的隐式转换可能会影响查询的结果。必要时,可以使用 explicit 类型转换调整这些结果。

In many cases a user does not need to understand the details of the type conversion mechanism. However, implicit conversions done by PostgreSQL can affect the results of a query. When necessary, these results can be tailored by using explicit type conversion.

本章介绍了 PostgreSQL 类型转换机制和约定。有关特定数据类型和允许的函数和运算符的更多信息,请参考 Chapter 8Chapter 9 中的相关章节。

This chapter introduces the PostgreSQL type conversion mechanisms and conventions. Refer to the relevant sections in Chapter 8 and Chapter 9 for more information on specific data types and allowed functions and operators.