[postgis-users] Why I got this using shp2pgsql: ERROR: invalid input syntax for type numeric : ""

Renato F. Salas rsalas at voxiva.net
Tue Aug 10 15:36:43 PDT 2004


Hi I've just installed PostGIS 0.8.2 with PostgreSQL 7.4.3 and use
shp2pgsql to generate a .sql file for loading my shape files onto the
database.

When I run the .sql using pgsql I got this:

[postgres at rsalas postgres]$ psql -d test -f Perudep.sql
BEGIN
psql:Perudep.sql:2: ERROR:  invalid input syntax for type numeric: ""
psql:Perudep.sql:3: ERROR:  current transaction is aborted, commands
ignored until end of transaction block
....[a lot more]

The problem seem to be that the auto-generated sql statements place ''
characters on the numeric values and the INSERT statements rejects to
use them as in:

INSERT INTO "testtable"
(gid,"area_","perimeter","perudep_","perudep_id","codigo_dep","nombre")
VALUES ('0','','3.738656662115','4','3','24','TUMBES'); 

The table structure is:

gid        | integer           |
area_      | numeric(19,0)     |
perimeter  | numeric(19,0)     |
perudep_   | numeric(19,0)     |
perudep_id | numeric(19,0)     |
codigo_dep | character varying |
nombre     | character varying |

Am I doing something wrong?

tHAnks in advance for you help

Renato F. Salas
www.renatonow.com







More information about the postgis-users mailing list