pgAdmin:
Open up pgAdmin, select the PostGIS database and click the SQL button.
From the SQL Query window, open up srid.sql. Click the "play"
button. You'll see a bunch of warnings but it will execute
successfully.
Command Line / psql:
Note that you'll either have to have your PATH environment variable
set or do this from within the Postgres bin directory. Enter the
command:
psql -u username -d the_posgis_database < srid.sql
-Abe
select * from spatial_ref_sys where auth_name='ESRI';
If it returns any records then you're golden.
Thanks.
-Abe
INSERT INTO "spatial_ref_sys" ("srid", "auth_name", "auth_srid",
"srtext", "proj4text")
VALUES (4023, 'ESRI', 4023,
'GEOGCS[\"GCS_International_1967\",DATUM[\"D_International_1967\",SPHEROID[\"International_1967\",
6378160,298.25]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",
0.017453292519943295]]', '+proj=longlat +ellps=aust_SA');
INSERT INTO "spatial_ref_sys" ("srid", "auth_name", "auth_srid",
"srtext", "proj4text")
VALUES (4217, 'ESRI', 4217,
'GEOGCS[\"GCS_Bern_1898\",DATUM[\"D_Bern_1898\",SPHEROID[\"Bessel_1841\",
6377397.155,299.1528128]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",
0.017453292519943295]]', '+proj=longlat +ellps=bessel');
... and ending:
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING: nonstandard use of escape in a string literal
LINE 1401: VALUES (104261, 'ESRI', 104261,
'GEOGCS[\"GCS_Merchich_Degre...
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING: nonstandard use of escape in a string literal
LINE 1404: VALUES (104304, 'ESRI', 104304,
'GEOGCS[\"GCS_Voirol_1875_De...
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING: nonstandard use of escape in a string literal
LINE 1407: VALUES (104305, 'ESRI', 104305,
'GEOGCS[\"GCS_Voirol_Unifie_...
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR: duplicate key value violates unique constraint
"spatial_ref_sys_pkey"
********** Error **********
ERROR: duplicate key value violates unique constraint
"spatial_ref_sys_pkey"
SQL state: 23505
-- Executing query:
select * from spatial_ref_sys where auth_name='ESRI';
Total query runtime: 110 ms.
0 rows retrieved.
Should try the command line method?
Arto
Remove the BEGIN; and END; lines from the top and bottom of the
script. Then run it. Remove, one-by-one, each INSERT INTO [...]
statement from the top and run. Do this until it succeeds.
IIRC it's one of the first 10 statements that's causing the problem.
So it shouldn't be too much work. Please report back here if you
figure out which one is causing the problem.
Thanks.
-Abe
> --
> You received this message because you are subscribed to the Google Groups "zigGIS" group.
> To post to this group, send email to zig...@googlegroups.com.
> To unsubscribe from this group, send email to ziggis+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ziggis?hl=en.
>
>