Skip site navigation (1) Skip section navigation (2)

Re: the '::' cast doesn't work in the FROM clause

From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: the '::' cast doesn't work in the FROM clause
Date: 2011-08-29 14:11:20
Message-ID: 1804685E-C378-49E1-B12C-96078B221102@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Aug 29, 2011, at 5:02 PM, Kevin Grittner wrote:

> Alexey Klyukin <alexk(at)commandprompt(dot)com> wrote:
> 
>> Function calls can appear in the FROM clause. (This is especially
>> useful for functions that return result sets, but any function can
>> be used.) This acts as though its output were created as a
>> temporary table for the duration of this single SELECT command.
> 
> It doesn't say that operators which provide equivalent functionality
> to functions can also be used.

I agree, but why is it possible to use the type casting with CAST there? Doesn't this break the promise of equivalency between the 'CAST .. ' and '::'?

select val from CAST(random() as integer) as val;
 val 
-----
   1
(1 row)

--
Alexey Klyukin        http://www.commandprompt.com
The PostgreSQL Company – Command Prompt, Inc.





In response to

Responses

pgsql-bugs by date

Next:From: Kevin GrittnerDate: 2011-08-29 14:29:33
Subject: Re: the '::' cast doesn't work in the FROM clause
Previous:From: Kevin GrittnerDate: 2011-08-29 14:02:57
Subject: Re: the '::' cast doesn't work in the FROM clause

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group