what is this error mean

invalid input syntax for type numeric
what is this error mean
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

earth man2Connect With a Mentor Commented:
Note: strict use of blanks ie no double blanks used as delimiter and blank after record with null mark.
psql -U postgres -q devdb
devdb=# \! cat csvimport.csv
name mark
alex 54
david 44
devdb=# COPY tablex(name, mark) FROM '/home/postgres/csvimport.csv' DELIMITER AS ' ' NULL AS '' C
devdb=# select * from tablex;
 name  | mark
 alex  |   54
 helen |
 david |   44
(3 rows)

earth man2Commented:
the parser is is having difficulty transforming one type into a numeric value.
try an explicit cast.
cast( xxx as numeric )
if that fails then you need to look at what characters are in that string.  Is it Nan +Infinity ???
tankergoblinAuthor Commented:
i dont know what you mean
can you explain it in detail thank you

what do you mean by cast(xxx as numeric)

and waht is NAN + infinity

earth man2Commented:
You have started another thread.  But from the extra information that you have provided there you are trying to equate a numeric column to an empty string, which gives rise to this "invalid input syntax".
(which may be coming from the DBD::PgPP interface)

+- Infinity and Nan are valid IEEE 754 entities.

create table x ( id int, y numeric );

insert into x ( id ) values (1);
insert into x values ( 2, default );
insert into x values ( 3, null );
tankergoblinAuthor Commented:
i insert data into database is base on the data in a text file. that mean i m manually add data into database.

in my text file i have

name  mark
alex   54
david 44

how to make it able to read null in mark as numeric data..
All Courses

From novice to tech pro — start learning today.