Re: [GENERAL] A mistake generates strange result - Mailing list pgsql-general

From sdupille@i-france.com (Stéphane Dupille)
Subject Re: [GENERAL] A mistake generates strange result
Date
Msg-id m3iudcdkhw.fsf@gromit.adrenaline.fr
Whole thread Raw
In response to A mistake generates strange result  ("Ricardo J.C.Coelho" <pulsar@truenet-ce.com.br>)
List pgsql-general
    Hi !

"Ricardo J.C.Coelho" <pulsar@truenet-ce.com.br> writes:
> Just for PgSQL's development group think about....
> I made a mistake typing a query that generates a strange result
> (Very strange).

> The query: select text('12345678'::float8);
> It returns a date in datetime format !!!!!!

    I didn't found any function of name "text" that converts
float8 to text. So I think Postgres made an implicit cast of the data
to datatime. So: String->Float8->DateTime->Text. Stranger : I didn't
found any function to cinvert float to text !

> If you use: select ('12345678'::float8)::text;        everything runs well.

    Here, you made an explicit cast, without the use of any
function. So your data is casted well.

    Hope this helps !

pgsql-general by date:

Previous
From: Clark Evans
Date:
Subject: Using As with Inheritance?
Next
From: Oleg Broytmann
Date:
Subject: Re: [GENERAL] New Software Database is Live ...