Re: [GENERAL] Cast to integer

2005-10-06 Thread Robert Osowiecki
A. Kretschmer wrote: 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?

Re: [GENERAL] Cast to integer

2005-10-05 Thread Tom Lane
Robert Osowiecki <[EMAIL PROTECTED]> writes: > 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? The latter is not really a cast; it's an invocation of the int datatype's input function. regard

Re: [GENERAL] Cast to integer

2005-10-05 Thread A. Kretschmer
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.3

Re: [GENERAL] Cast to integer

2005-10-05 Thread Sean Davis
On 10/5/05 9:08 AM, "Robert Osowiecki" <[EMAIL PROTECTED]> wrote: > 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? How about: sdavis=# s

[GENERAL] Cast to integer

2005-10-05 Thread Robert Osowiecki
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? Regards, Robert. ---(end of broadcast)--- TI