[postgis-users] Possible bug in shp2psql
Paul Ramsey
pramsey at refractions.net
Wed Feb 12 09:16:42 PST 2003
I dunno... bug? :) More of an interpretation thing...
That's a 14-digit parcel number, it's not really a number, since
numerically it has no meaning. It could be modelled just as well
(better?) as a varchar. Probably it is declared as a number(14,0) in the
DBF file though, so shp2pgsql tries to make it an integer. The code just
needs another test, so that if the number of requested digits in a
numeric field is > 9, then int8 is used instead of int4. That still will
not save us from people who declare 100-digit strings as number(100,0)
though.
P.
christian.schuster at rsag.ch wrote:
>
> I have a shape file which I could convert to a SQL statement file
> with shp2pgsql. The surprise came as I wanted to insert data into
> PostgreSQL. It was not possible because the data type of one column
> was wrong. Instead of int8 it was declared as int4. I am not an
> expert with shapefiles and shp2pgsql at all. So, I am not sure where
> the problem is. After I changed the int4 to int8 of the column PARCEL
> in the SQL-file I could insert the data.
>
> I attached the shape file as well as the SQL file which shp2pgsql
> created.
>
> System: Win2000 Cygwin PostgreSQL-7.3.1-1 PostGIS-CVS (02-10-2003)
>
>
> (See attached file: test.sql)(See attached file: test.shp)(See
> attached file: test.shx)(See attached file: test.dbf) Regards,
>
>
> Christian Schuster
>
> Rudolf Schuster AG Postfach 277 CH - 3000 Bern 11
>
> http://www.rsag.ch ++41 31 348 05 30
>
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________ postgis-users mailing
> list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
--
__
/
| Paul Ramsey
| Refractions Research
| Email: pramsey at refractions.net
| Phone: (250) 885-0632
\_
More information about the postgis-users
mailing list