From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: alexk@commandprompt.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: the '::' cast doesn't work in the FROM clause
Date: Mon, 29 Aug 2011 09:00:21 -0500
Message-ID: <4E5B552502000025000407EB@gw.wicourts.gov> (raw)
In-Reply-To: <CAHyXU0x-MgGEfa+P4+6fR=4q2k542P58QBQqn7cWcEqU3sdGTg@mail.gmail.com>
References: <4E5B449602000025000407D9@gw.wicourts.gov>
<CAHyXU0x-MgGEfa+P4+6fR=4q2k542P58QBQqn7cWcEqU3sdGTg@mail.gmail.com>
Merlin Moncure <mmoncure@gmail.com> wrote:
> yeah, that's the correct way, but why does this work?
> select val from random() as val;
If you look at the PostgreSQL reference docs for the SELECT
statement, a from_item can be a SELECT statement in parentheses or a
function call (among other things). It cannot be an arbitrary
expression containing operators (like ::).
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, mmoncure@gmail.com, alexk@commandprompt.com
Subject: Re: the '::' cast doesn't work in the FROM clause
In-Reply-To: <4E5B552502000025000407EB@gw.wicourts.gov>
References: <4E5B449602000025000407D9@gw.wicourts.gov> <CAHyXU0x-MgGEfa+P4+6fR=4q2k542P58QBQqn7cWcEqU3sdGTg@mail.gmail.com> <4E5B552502000025000407EB@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox