[postgis-users] Upgrade from 1.5 Linux to 2.0 Windows Problem with wkb and srid!

Stephen Woodbridge woodbri at swoodbridge.com
Thu Mar 14 16:59:32 PDT 2013


Hi all,

OK, I'm feeling dumb at the moment. I have a small pg_dump in -Fp format 
that contains a couple of tables with under 30 rows total. One table has 
some geometry in it. And there are NO postgis stuff in this dump.


When I try to load it I get the following error:

$ psql -U postgres -h localhost -f core/trsp/test/trsp-test-data.sql test1
BEGIN
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
CREATE TABLE
CREATE SEQUENCE
ALTER SEQUENCE
  setval
--------
       1
(1 row)


CREATE TABLE
ALTER TABLE
psql:core/trsp/test/trsp-test-data.sql:121: ERROR:  new row for relation 
"edges1
" violates check constraint "enforce_srid_the_geom"
DETAIL:  Failing row contains (1, B, 1, 2, 1, 1, 2, 0, 2, 1, null, null, 
0102000
000020000000000000000000040000000000000000000000000000000...).
CONTEXT:  COPY edges1, line 1: "1       B       1       2       1       1
2       0       2       1       \N      \N 
01020000000200000000000000000000
400000000000000000000000000000004000000000..."
psql:core/trsp/test/trsp-test-data.sql:128: ERROR:  current transaction 
is abort
ed, commands ignored until end of transaction block
psql:core/trsp/test/trsp-test-data.sql:129: invalid command \N
psql:core/trsp/test/trsp-test-data.sql:131: invalid command \N
psql:core/trsp/test/trsp-test-data.sql:132: invalid command \.
psql:core/trsp/test/trsp-test-data.sql:139: ERROR:  syntax error at or 
near "1"
LINE 1: 1 100 7 4
         ^
psql:core/trsp/test/trsp-test-data.sql:140: invalid command \N
psql:core/trsp/test/trsp-test-data.sql:141: invalid command \.
psql:core/trsp/test/trsp-test-data.sql:149: ERROR:  syntax error at or 
near "1"
LINE 1: 1 100 7 4
         ^
psql:core/trsp/test/trsp-test-data.sql:157: ERROR:  current transaction 
is abort
ed, commands ignored until end of transaction block
ROLLBACK

If I pull out one geometry from the file above:
010200000002000000000000000000004000000000000000000000000000000040000000000000F03F

test1=# select 
st_astext('010200000002000000000000000000004000000000000000000000000000000040000000000000F03F');
       st_astext
---------------------
  LINESTRING(2 0,2 1)
(1 row)

test1=# select 
st_srid('010200000002000000000000000000004000000000000000000000000000000040000000000000F03F'::geometry);
  st_srid
---------
        0
(1 row)

So did the format of wkbhex change?
How are we supposed to load old dumps?

Thanks,
   -Steve


More information about the postgis-users mailing list