Re: - Mailing list pgsql-general

From jose' soares
Subject Re:
Date
Msg-id 36C80F90.643B39E0@bo.nettuno.it
Whole thread Raw
In response to ...  ("Doug Smith" <doug@the-bridge.net>)
List pgsql-general
 

Doug Smith ha scritto:

 I have a field that is presently an int4 and I would like to change it and it's contents to a float. I tried building a new table and insert the data into the new field but I getthe error "type of <a> does not match target column <b>". Is there a convert function available? Sure would appriciate some help, besides spelling..ThanksDoug
prova=> create table test(i int4);
CREATE
prova=> insert into test values (1);
INSERT 188494 1
prova=> create table test1 ( f float);
CREATE
prova=> insert into test1 select float8(i) from test;
INSERT 188504 1
prova=> select * from test1;
f
-
1
(1 row)

--
                               - Jose' -

And behold, I tell you these things that ye may learn wisdom; that ye may
learn that when ye are in the service of your fellow beings ye are only
in the service of your God.                - Mosiah 2:17 -
 

pgsql-general by date:

Previous
From: Remigiusz Sokolowski
Date:
Subject: Re: [GENERAL] A book for PgSQL? A need? yes? no?
Next
From: Ingrith Andrea Correa Vargas
Date:
Subject: Encapsulation