Brent Verner <brent@rcfile.org> writes:
> Something is strange, tho.
The construct you're poking around the edges of here is
type-name literal-string
which is an SQLish typed constant. (Or more accurately, it's Thomas'
generalization of some type-specific constant syntaxes that appear in
SQL92. AFAIK the spec itself doesn't claim this is a type-universal
construction.)
Casting something other than a string literal requires different, more
explicit syntax; eg, CAST(foo AS type), foo::type, or if the type name
is allowable as a function name type(foo) will work.
regards, tom lane