Re: [GENERAL] A mistake generates strange result

From: sdupille(at)i-france(dot)com ( Stéphane Dupille)
To: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] A mistake generates strange result
Date: 1999-02-09 08:55:23
Message-ID: m3iudcdkhw.fsf@gromit.adrenaline.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Hi !

"Ricardo J.C.Coelho" <pulsar(at)truenet-ce(dot)com(dot)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 !

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Broytmann 1999-02-09 15:06:59 Re: [GENERAL] New Software Database is Live ...
Previous Message Clark Evans 1999-02-09 04:40:06 Using As with Inheritance?

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas IZ5 1999-02-09 09:14:26 AW: [HACKERS] Embedded SQL question
Previous Message Oleg Broytmann 1999-02-09 08:13:29 Re: [HACKERS] VACUUM ANALYZE problem on linux