OK, I see a patch from 2001-09-10 for parse_target.c which is a smoking
gun. The patch tries to force a column name for the TypeCast node, and
doesn't check to see if one was actually specified :(
So that probably explains why, on my system,
select cast(int4 '1' as float8);
fails, while
select cast(int4 '1' as float8) as "foobar";
succeeds.
Ouch. I've wasted a bunch of time on this.
- Thomas