pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feed:) Import file2table Question
2+ messages / 2 participants
[nested] [flat]
* :) Import file2table Question
@ 1998-07-06 09:31 Korapat Charukumnerdkanok <korapat.c@cdg.co.th>
0 siblings, 1 reply; 2+ messages in thread
From: Korapat Charukumnerdkanok @ 1998-07-06 09:31 UTC (permalink / raw)
To: pgsql-general@postgreSQL.org
Good Morning,
@^_^@
Could you please tell me ....
1 -How can I import a text file into Postgres table ?
(append to the last row)
-What is the format of that text file ?
This is what I've done and its result....
ProjDB=> copy PrjTB from /prj_data/test.txt using delimiters ,
ProjDB-> ;
ERROR: parser: syntax error at or near "/"
2 -What table field type that suits for 6-digit decimal number..
(i.e. 0.000000, 0.250001 , 0.123456 , ....)?
I've defined this column with float4 and float8
but when I inserted data it returned this error message..
ProjDB=> insert into PrjTB values (0.000000,'red','Ln1')
ProjDB->;
ERROR: pg_atoi: error in "0.000000": can't parse ".000000"
Thank You for your advance help,
Korapat Charu.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [GENERAL] :) Import file2table Question
@ 1998-07-06 13:49 Herouth Maoz <herouth@oumail.openu.ac.il>
parent: Korapat Charukumnerdkanok <korapat.c@cdg.co.th>
0 siblings, 0 replies; 2+ messages in thread
From: Herouth Maoz @ 1998-07-06 13:49 UTC (permalink / raw)
To: Korapat Charukumnerdkanok <korapat.c@cdg.co.th>; +Cc: pgsql-sql
(Redirected to the SQL list)
At 12:31 +0300 on 6/7/98, Korapat Charukumnerdkanok wrote:
> 2 -What table field type that suits for 6-digit decimal number..
> (i.e. 0.000000, 0.250001 , 0.123456 , ....)?
>
> I've defined this column with float4 and float8
> but when I inserted data it returned this error message..
>
>
> ProjDB=> insert into PrjTB values (0.000000,'red','Ln1')
> ProjDB->;
> ERROR: pg_atoi: error in "0.000000": can't parse ".000000"
Must be something wrong with your installation - or your table definition.
In my case:
testing=> create table test ( col1 float8 );
CREATE
testing=> insert into test values ( 0.3 );
INSERT 758126 1
testing=> insert into test values ( 0.000003 );
INSERT 758127 1
testing=> insert into test values ( 0 );
INSERT 758128 1
testing=> insert into test values ( 0.0 );
INSERT 758129 1
testing=> insert into test values ( 0.000000 );
INSERT 758130 1
testing=> select * from test;
col1
-----
0.3
3e-06
0
0
0
(5 rows)
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-07-06 13:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-06 09:31 :) Import file2table Question Korapat Charukumnerdkanok <korapat.c@cdg.co.th>
1998-07-06 13:49 ` Herouth Maoz <herouth@oumail.openu.ac.il>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox