Search Postgresql Archives

Re: numeric precision when raising one numeric to another.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 20, 2005 at 01:03:08PM -0400, Tom Lane wrote:

> But having said that, I don't have a problem with putting in a
> pg_operator entry for numeric_power.  And if someone wants to improve
> the scale factor calculations therein, go for it.

Oh, and while at it, it would be nice to solve the modulo bug that still
lurks there:

alvherre=# select 12345678901234567890 % 123;
 ?column? 
----------
      -45
(1 fila)

alvherre=# select 12345678901234567890 % 123::numeric(4,1);
 ?column? 
----------
     78.0
(1 fila)

alvherre=# select 12345678901234567890 % 123::numeric(3,0);
 ?column? 
----------
      -45
(1 fila)

alvherre=# select version();
                                           version                                            
----------------------------------------------------------------------------------------------
 PostgreSQL 8.1devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.6 (Debian 1:3.3.6-4)
(1 fila)

-- 
Alvaro Herrera (<alvherre[a]surnet.cl>)
"I call it GNU/Linux. Except the GNU/ is silent." (Ben Reiter)

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux