Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJzJl-00039h-KC for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Nov 2017 10:10:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJzJl-000763-1t for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Nov 2017 10:10:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJzDf-0005QV-9r for pgsql-bugs@lists.postgresql.org; Wed, 29 Nov 2017 10:03:55 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eJzDc-0007Cw-8G for pgsql-bugs@postgresql.org; Wed, 29 Nov 2017 10:03:54 +0000 Received: by mail-wm0-x235.google.com with SMTP id r78so4964642wme.5 for ; Wed, 29 Nov 2017 02:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version; bh=cVz3JzyjqfUCV18EWQ+FIQI0MMNpwYDNNiyl74P4btY=; b=Sd4+2j41LeYt3LvVHgEhE6B8t9Xm2RjnTVqO0IBZyqRWPGUA+XuZ3hMz1U5c/7edxJ hHriuo4w5nAJXiBxhVq3mMsIfj+/QSU960XprPrw1gZNPsCz6JkAN1B/ob5Vkujg0PaV Ub2wPD1tzazVKIB+nyk919yBfhvdo3ka5FMMsn05h0QJ8MQKChA7Og8Sk+qvIu0UHtbL dH/2ltdXUAu10PSwVGCIuv+qDEII0lwZrDJtXZbHcfFmesUJpSTvMtVA0otknfq5HydQ BoABLFeyiQYlzknsfpfYEOPqK1GCqP7qwx9OiG7ApL4/O/NZ23mmsOjFZov4FgqxRjun YT5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version; bh=cVz3JzyjqfUCV18EWQ+FIQI0MMNpwYDNNiyl74P4btY=; b=Ng9xf7Y0cFjH5q2+GLLLlHMPeJkDENSHArgot7j1sRmpk4/12jk4vDqtKzu09c/o9B oeewiVF/oAnxYSMfCMMrA7ZG79ffp8Tj1BWa0yd5ml6Z7Jl7XmYnOanVIru4bjPC80lr bc8BRg6lxgxVDWzzE4L4QxTNwtsUx51YZOA8NRiGCESXjZPNG2MT+ku7xhesGjaSTX6L MuXXpPeL+G0UTvYkN8djFB3CDAAJztJyIH7Wo1dIamfPrgqsQVEyixPaOvt2VRh9fRzF z6STBWBWBX7cYHrItj+CL22PsM5v6M5KAMfAVvgbkaXkewBSA7nnAmnvIjZ4QtwiM/81 l3cA== X-Gm-Message-State: AJaThX4TrtbMVwqE4b1QdttG05Mh/keaN0lz120rCL5NJxF+jseFreBb Zxz5W+6hZMQjEVGKSK9AmOI= X-Google-Smtp-Source: AGs4zMaLgThNUtiDpkimSTXUjmi/4NXNTJ1Z0GtUyNSGtkqTGHtJpC+DJabLzt0YdHg9mf8BXWMi7w== X-Received: by 10.28.218.70 with SMTP id r67mr1861300wmg.14.1511949829479; Wed, 29 Nov 2017 02:03:49 -0800 (PST) Received: from [192.168.5.10] (93-137-158-20.adsl.net.t-com.hr. [93.137.158.20]) by smtp.gmail.com with ESMTPSA id b9sm649595wrf.59.2017.11.29.02.03.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 02:03:48 -0800 (PST) Date: Wed, 29 Nov 2017 11:03:46 +0100 From: =?utf-8?Q?Jurica_=C5=BDeleznjak?= To: Marko Tiikkaja Cc: Pg Bugs Message-ID: <96b6da9f-83f5-4d4b-a844-797d6e97e617@Canary> In-Reply-To: References: <20171129082705.1464.33608@wrigleys.postgresql.org> Subject: Re: BUG #14935: Cast function shortcut gives an error MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5a1e8603_327b23c6_1171" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5a1e8603_327b23c6_1171 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 wrote: > On Wed, Nov 29, 2017 at 10:27 AM, 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 --5a1e8603_327b23c6_1171 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <= meta name=3D=22viewport=22 content=3D=22width=3Ddevice-width, initial-sca= le=3D1.0, user-scalable=3Dno=22>
Ok. Thanks... I guess I should bring attention to this to the Django t= eam where they use it without the parenthesis.

Jurica

<= div id=3D=22CanaryDropbox=22>
On Wednesday, Nov 29, 2017 at 10:52 AM, Marko Tiikkaja &l= t;marko=40joh.to> wrote:
=
On Wed, Nov 29, 2017 at 10:27 AM, <jzelez=40gmail.com> wrote:
In some cases when using the short= cut notation =22::=22 the database gives an
error.

GOOD:
= CAST(=22sensors=5Fsensordata=22.=22data=22 =23>> '=7BTemperat= ure=7D' AS DOUBLE PRECISION) AS
=22temp=22

ERROR:
=22sen= sors=5Fsensordata=22.=22data=22 =23>> '=7BTemperature=7D'::DOUBLE P= RECISION AS
=22temp=22

The preced= ence between the two is different.=C2=A0 The equivalent would be:

=C2=A0 (=22sensors=5Fsensordata=22.=22data=22 =23>&g= t; '=7BTemperature=7D')::DOUBLE PRECISION

I= n other words, not a bug.


.m<= br>
--5a1e8603_327b23c6_1171--