postgresql - Postgres 中的这种类型 'literal' 语法是什么?

标签 postgresql casting postgresql-9.4

Postgres docs说 Actor 应该看起来像...

expression::typename
typename(expression)
cast(expression as typename)

但这行得通:

select date '2015-06-20';

这是什么语法?它在哪里记录?

最佳答案

它是类型常量 - 参见 http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html 4.1.2.7 节。其他类型的常量

A constant of an arbitrary type can be entered using any one of the following notations:

type 'string'
'string'::type
CAST ( 'string' AS type )

关于postgresql - Postgres 中的这种类型 'literal' 语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30967839/

相关文章:

sql - postgresql alter table 在 created_at 上添加带有排序值的列序列

postgresql - 检索特定角色的所有对象权限

Azure 流分析将 int64 输出为 int32

swift - 如何在 swift 中使用带有开关的 AS 来获取类类型

sql - Postgres 9.4 sql查询超时

django - JSONB PostgreSQL 类型 : how to lookup

postgresql - 带有 dbname 的 pg_dump - 端口号无效?

sql - 如果 value1 为 NULL,则将 value1 添加到 value2 或将 0(零)添加到 value2

ios - 将 swift 类型转换为相同类型,为什么会起作用?

postgresql - 如何在 PostgreSQL 中以编程方式查找继承表?