Postgres 中的这种 'literal' 语法是什么?

What is this type 'literal' syntax in Postgres?

Postgres docs 说演员应该看起来像...

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 )