Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2234 closed defect (fixed)

shp2pgsql fails on altering target table (and subsequently)

Reported by: leaffan Owned by: robe
Priority: medium Milestone: PostGIS 2.0.3
Component: postgis Version: 2.0.x
Keywords: shp2pgsql geometry windows64 Cc: leaffan@…

Description

Dear all, unfortunately I have a bug to report. For me, shp2pgsql fails on a 64bit installation on Windows 7. This also happens on a clean install (PostgresSQL 9.2.3 x64 + PostGIS 2.0.3 x64). This is a sample output of the failing command:

C:\Program Files\PostgreSQL\9.2\bin>shp2pgsql.exe d:\sync\shp\wp4_extent.shp wp4_extent
Shapefile type: Polygon
Postgis type: MULTIPOLYGON[2]
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "wp4_extent" (gid serial,
"id" int4);
'MIdINSERT INTO "wp4_extent" ("id",geom) VALUES ('0','');
COMMIT;

While this is what happens when I use shp2pgsql from version 2.0.1/2.0.2:

C:\Program Files\PostgreSQL\9.2\bin>shp2pgsql_.exe d:\sync\shp\wp4_extent.shp wp4_extent
Shapefile type: Polygon
Postgis type: MULTIPOLYGON[2]
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "wp4_extent" (gid serial,
"id" int4);
ALTER TABLE "wp4_extent" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','wp4_extent','geom','0','MULTIPOLYGON',2);
INSERT INTO "wp4_extent" ("id",geom) VALUES ('0','0106000000010000000103000000010000000500000000DF107759530441D4EDF205363A5841804B35B314842E41D4EDF205363A5841804B35B314842E41F0D6C771657E534100DF107759530441F0D6C771657E534100DF107759530441D4EDF205363A5841');
COMMIT;

Maybe someone can confirm - or even better - fix this. Thanks in advance. Regards, Markus

Change History (8)

comment:1 by robe, 12 years ago

Owner: changed from mcayland to robe

bummer. Okay will check on this

comment:2 by robe, 12 years ago

leaffan,

Can you do me a favor and try the same process using the gui -- shp2pgsql-gui packaged.

I'm suspecting its the NLS stuff biting which is similar to here #2230

comment:3 by robe, 12 years ago

Yap confirmed. I'm definitely seeing something screwy. I suspect I forgot to put in a replace hack I normally do for x64 bit.

comment:4 by robe, 12 years ago

leaffan,

I'm rebuilding the packages. In meantime can you check and see if the one from 2.0.4SVN zip fixes your issue. http://winnie.postgis.net/download/windows/pg92/buildbot/

I thought my tag job was regressing, but it wasn't which is why it slipped thru the cracks.

comment:5 by robe, 12 years ago

Component: loader/dumperpostgis
Keywords: windows64 added

This also effects the postgis.dll so you're want to replace the libraries as well in lib folder.

comment:6 by robe, 12 years ago

Resolution: fixed
Status: newclosed

Leaffan,

Sorry about this and thanks for the bug report. Really important catch.

I've repackaged. The good one has a -2.exe and can download from -- http://download.osgeo.org/postgis/windows/pg92/ This effects the core postgis functionality, so you'll want to reinstall

comment:7 by robe, 12 years ago

Milestone: PostGIS 2.0.3

in reply to:  6 comment:8 by leaffan, 12 years ago

Hej, downloaded the package again, retried and it worked. Thanks for the quick fix. Regards, Markus

Note: See TracTickets for help on using tickets.