|
PostgreSQL Books Thursday, December 24. 2009PgAdmin III Plug-in Registration: PostGIS Shapefile and DBF LoaderRecommended Books: PostGIS In Action PostgreSQL 8.4 Official The SQL Language PostgreSQL 8.4 Server Administration
![]()
Recommended Books: PostGIS In Action PostgreSQL 8.4 Official The SQL Language PostgreSQL 8.4 Server Administration
Comments
Display comments as
(Linear | Threaded)
I have installed the gui, but keep getting errors when I try to load a shapefile. Below is an example:
Connection: user=postgres password=******** port=5432 host=localhost dbname=postgres Destination: public.hgac_zipcode Source File: C:\ARC Files\GPL\Data2SDS\HAR2SDS\tx.houston\Data\Zipcode\hgac_zipcode Shapefile type: Polygon Postgis type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."hgac_zipcode" (gid serial PRIMARY KEY, "objectid_1" numeric(10,0), "objectid" numeric(10,0), "zip" varchar(5), "po_name" varchar(28), "state" varchar(2), "s" Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 16: SELECT AddGeometryColumn('public','hgac_zipcode','the_geom',... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Shapefile import failed. Do I need to be setting something different in the Configuration or the Options? I currently have the following: Configuration: Destination Schema: public SRID: -1 Destination Table: hgac_zipcode Geometry Column: the_geom Options: DBF file character encoding: WINDOWS-1252 and only "Create spatial index automatically after load" checked. Thanks for any help!
Melanie,
From the error, it seems you don't have PostGIS enabled in your database. The easiest way to enable it is to Create a new database and choose template_postgis for the template. Then you should be able to load this shape file into that PostGIS enabled database.
Problems with "standard_conforming_strings" in the GUI interface of shp2psql:
--------- I cannot device how can be toggled to off this parameter. My DB is 8.1 and does not let me change it to "obbey" the imports form shp2psql. Always I get the same message. I paste it in extense: Shapefile import failed. Connection: user=fesago password=*** port=5432 host=127.0.0.1 dbname=mapasand Destination: public.andalucia100 Source File: C:\Documents and Settings\Felix\Escritorio\andalucia100 Shapefile type: Polygon Postgis type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."andalucia100" (gid serial PRIMARY KEY, "clave" int4, "nombre" varchar(30)); SELECT AddGeometryColumn('public','andalucia100','the_geom','-1','MULTIPOLYGON'," Failed in pgui_exec(): ERROR: parameter "standard_conforming_strings" cannot be changed
Felix,
Which version of PostGIS are you running? Unfortunately I fear this may be a limitation in PostgreSQL 8.1, that may be unavoidable. One thing that might work -- is click "Options" and check the "use copy" instead. The PostGIS GUI was packaged with PostGIS 1.5 which only supports PostgreSQL 8.3+. I have tried it in PostgreSQL 8.2 and workks fine. It was really just a stroke of luck that it works against lower versions of PostGIS and PostgreSQL. Evidentally I guess PostgreSQL 8.1 is too low. I'll ask the developers to see if anything can be done about this, but I suspect the answer will be no.
Ok I guessed 8.1 might be the "problem" (what abot a little of backwrds compatibility? Uhmm! we are talking not on Pg 7 or such.. 8.1 is not that old!). So, I am in the tiring processs of upgrading te server. It should be done at certain momment, but not just because of such importation. Uhmmm! (again!).
About the other propssed solution (working with the options), none of them seems to make it work. I could even say that none of the possible combinations of them. Still I gess It shoul be easier to make the GUI able to make this parameter on and off. There must be a huge ammount of 8.1 (and lower) installations running over tehere, and not all of them willing to upgrade. Many thanks, in any case. The tool seems easing a obnoxious task when not done throught "programming" a batch file. Thanks also for the early response! Regards
I know, but we had to make a decision to support older versions vs. look to the future.
So for each new version of PostGIS we support only 2 or 3 PostgreSQL versions. We do maintain support for older versions of PostGIS on older PostgreSQL, but do not try to make new features such as the GUI work with older versions. It was a decision made to make testing on all platforms and supported PostgreSQL versions manageable. |
QuicksearchCalendarCategoriesBlog AdministrationEntry's LinksShow tagged entries |
Tracked: Dec 24, 20:32
Tracked: Mar 25, 13:16
Tracked: Mar 31, 09:56