From: Jurica Železnjak <jzelez@gmail.com>
To: Marko Tiikkaja <marko@joh.to>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14935: Cast function shortcut gives an error
Date: Wed, 29 Nov 2017 11:03:46 +0100
Message-ID: <96b6da9f-83f5-4d4b-a844-797d6e97e617@Canary> (raw)
In-Reply-To: <CAL9smLAt8rmHb32Dn7cxuEhwe74=+CzYsbWC8W9yY3ueKbQnLQ@mail.gmail.com>
References: <20171129082705.1464.33608@wrigleys.postgresql.org>
<CAL9smLAt8rmHb32Dn7cxuEhwe74=+CzYsbWC8W9yY3ueKbQnLQ@mail.gmail.com>
Ok. Thanks... I guess I should bring attention to this to the Django team where they use it without the parenthesis.
Jurica
> On Wednesday, Nov 29, 2017 at 10:52 AM, Marko Tiikkaja <marko@joh.to (mailto:marko@joh.to)> wrote:
> On Wed, Nov 29, 2017 at 10:27 AM, <jzelez@gmail.com (mailto:jzelez@gmail.com)> wrote:
> > In some cases when using the shortcut notation "::" the database gives an
> > error.
> >
> > GOOD:
> > CAST("sensors_sensordata"."data" #>> '{Temperature}' AS DOUBLE PRECISION) AS
> > "temp"
> >
> > ERROR:
> > "sensors_sensordata"."data" #>> '{Temperature}'::DOUBLE PRECISION AS
> > "temp"
>
> The precedence between the two is different. The equivalent would be:
>
> ("sensors_sensordata"."data" #>> '{Temperature}')::DOUBLE PRECISION
>
> In other words, not a bug.
>
>
> .m
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: jzelez@gmail.com, marko@joh.to
Subject: Re: BUG #14935: Cast function shortcut gives an error
In-Reply-To: <96b6da9f-83f5-4d4b-a844-797d6e97e617@Canary>
References: <20171129082705.1464.33608@wrigleys.postgresql.org> <CAL9smLAt8rmHb32Dn7cxuEhwe74=+CzYsbWC8W9yY3ueKbQnLQ@mail.gmail.com> <96b6da9f-83f5-4d4b-a844-797d6e97e617@Canary>
* 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