[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 17:09:50 PDT 2013
Got it, I had to change the table constrain for srid from -1 to 0. I
could find any doc on this change, although I vaguely remember something
about it once I realized that my test data did not have an srid. This
means we need script that can scan an Fp dump and look for and change
this. Thankfully, most of my data does have an srid set.
-Steve
On 3/14/2013 7:59 PM, Stephen Woodbridge wrote:
> 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
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list