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

Re: Select (str)::FLOAT8 BUG

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rafael Villalobos Prats" <rvillalobos(at)asapci(dot)es>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Select (str)::FLOAT8 BUG
Date: 2004-02-18 16:36:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"Rafael Villalobos Prats" <rvillalobos(at)asapci(dot)es> writes:
> Why is different: 'SELECT (xxxxx)::FLOAT8' than 'SELECT xxxxx::FLOAT8'

The :: operator binds more tightly than most other operators.  As Iain
replied, most of your divisions are going to be integer divisions that
discard the fractional part.  You can either add casts or add ".0" to
your numbers to cause them to be considered non-integers.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Alexander TroppmannDate: 2004-02-19 18:16:42
Subject: Maybe a bug found with nextval() function
Previous:From: Tom LaneDate: 2004-02-18 16:05:41
Subject: Re: zlib directory in configure.

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