Search Postgresql Archives

Re: Cast to integer

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

 



am  05.10.2005, um 15:08:33 +0200 mailte Robert Osowiecki folgendes:
> Hello!
> 
> Anyone could explain to me, why cast(3.33 to int) works (from float, I 
> suppose)  but cast('3.33' to int) (from text) does not? And what if I 
> create a cast for that: is it possibly dangerous?

test=# select '3.33'::float::int;
 int4
------
    3
(1 row)



Regards, Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    === 

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, 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