Re: the '::' cast doesn't work in the FROM clause - Mailing list pgsql-bugs

From Tom Lane
Subject Re: the '::' cast doesn't work in the FROM clause
Date
Msg-id 2614.1314636336@sss.pgh.pa.us
Whole thread Raw
In response to Re: the '::' cast doesn't work in the FROM clause  (Alexey Klyukin <alexk@commandprompt.com>)
List pgsql-bugs
Alexey Klyukin <alexk@commandprompt.com> writes:
> On Aug 29, 2011, at 5:47 PM, Tom Lane wrote:
>> There is a dump/reload bug though :-( ... if you were to do
>>
>> create view vv as select val from CAST(random() as integer) as val;
>>
>> you will find that the system prints it out with the :: syntax,
>> which won't work.

> Would it be acceptable/sufficient to output  CAST(...) instead of '::'  for all casts in pg_dump to fix this problem,
assumingthat CAST can be used anywhere where '::' is accepted? 

I'm not really excited about that; CAST is more verbose and not
particularly more readable (at least IMO).  What I was wondering about
was altering the internal representation to remember which format had
been used, and reverse-listing in that same format.  That would both fix
this issue, and please users who have a stylistic preference for one or
the other format.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6181: concat_ws() incompatibility with MySQL
Next
From: Merlin Moncure
Date:
Subject: Re: the '::' cast doesn't work in the FROM clause