[postgis-users] populating a table

Obe, Regina robe.dnd at cityofboston.gov
Mon Mar 12 07:59:18 PDT 2007


Unfortunately the lwpostgis.sql varies depending on which version of postgis you are running so just giving it to you will probably cause more damage than good.
 
Do you remember how you installed the old database and what events happened before your old one stopped working?
 
First thing to check is to see if you have a template_postgis database or something of that sort. 
If you do then best bet is probably create a new database from scratch and choose template_postgis as the template database.  If you don't have that then
 
Next bet
 
If you are running PostGreSQL  on WinXP, then you can try out one of the Windows PostGIS installers found here.
 
http://postgis.refractions.net/download/windows/
 
Hope that helps,
Regina
 
 

________________________________

From: postgis-users-bounces at postgis.refractions.net on behalf of Malm Paul
Sent: Mon 3/12/2007 10:05 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] populating a table



I did createlang plpgsql yourtestdatabase: and got an answer that it was already installed

But I can not find any lwpostgis.sql spatial_ref_sys.sql on the disc. I'm on Windows XP. Yesterday I was able to insert Gis objects, but not today. So I droped my database and created a new one via pgAdmin III (All the same).

 

Since I did not find any of the SQL files you wrote about I Uninstalled PostGis, to try to install it again but the installation program reported that post was already installed... 

Could you please attach the sql files in a mail (if you got the time and patience).

Kind regards,

/Paul 

________________________________

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe, Regina
Sent: den 12 mars 2007 13:54
To: PostGIS Users Discussion
Subject: RE: [postgis-users] populating a table

 

Depends on what OS you are running?  But generally you load the postgis functions separately and you have to make sure you have plpgsql enabled in your database.

 

If you have the .so files (on unix)  or the .dll files on windows then you just have to load the functions in your db with

 

createlang plpgsql yourtestdatabase 
psql -d yourtestdatabase -f lwpostgis.sql 
psql -d yourtestdatabase -f spatial_ref_sys.sql 

 

If you don't have the functions then its a bit more involved.  The lwpostgis.sql and spatial_ref_sys.sql in a postgresql install prepackaged with postgis are usually located in the share\contrib and share\contrib\postgis folders.

 

 

 

 

 

________________________________

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Malm Paul
Sent: Monday, March 12, 2007 8:42 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] populating a table

Yes it is a new database, I can also see that the AddGeometryColumn has a green underscore in the SQL window in pgadmin: SELECT AddGeometryColumn('public','h1707640_cul_transl','the_geom','-1','MULTILINESTRING',2);

I have not seen any error messages when I created the database but I've not explicit loaded any functions as  AddGeometryColumn. Do you know how I do this or where to read about it?

Thanks!

Paul

 

 

________________________________

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe, Regina
Sent: den 12 mars 2007 13:22
To: PostGIS Users Discussion
Subject: RE: [postgis-users] populating a table

 

Is this a new database you are loading into?  Sounds like you are missing the addgeometrycolumn function perhaps because load of postgis functions failed when creating the database or you didn't load them.

 

Other possibility is that you have the addgeometrycolumn function, but it is not in your default schema or one of your search schemas.

 

________________________________

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Malm Paul
Sent: Monday, March 12, 2007 8:13 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] populating a table

Hi!

This has worked before, could anyone please tell me what's wrong?

I'm trying to create and populate a Table in my database with a script generated with shp2pgsql.exe SQL:

BEGIN;

CREATE TABLE "public"."h1707640_cul_transl" (gid serial PRIMARY KEY,

"f_code" varchar(5),

"f_code_des" varchar(254),

"exs" int2,

"exs_descri" varchar(254),

"tile_id" int2,

"edg_id" int4,

"shape_leng" numeric);

SELECT AddGeometryColumn('public','h1707640_cul_transl','the_geom','-1','MULTILINESTRING',2);

INSERT INTO "public"."h1707640_cul_transl" ("f_code","f_code_des","exs","exs_descri","tile_id","edg_id","shape_leng",the_geom) VALUES ('AP030','Road','28','Operational','1','6','3.05816496139e004','01050000000100000001020000000300000084F6FF3F5A8152C0580100E0D26144402C2000C05C8152C02A2E00C0D361444007EDFF1F5F8152C055210060D2614440');

END;

I'm getting the following error message:

NOTICE:  CREATE TABLE will create implicit sequence "h1707640_cul_transl_gid_seq" for serial column "h1707640_cul_transl.gid"

NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "h1707640_cul_transl_pkey" for table "h1707640_cul_transl"

ERROR: function addgeometrycolumn("unknown", "unknown", "unknown", "unknown", "unknown", integer) does not exist

SQL state: 42883

Hint: No function matches the given name and argument types. You may need to add explicit type casts.

Character: 225

Paul Malm

Saab Systems, Naval Systems Division

Tel: +46 8 580 838 22

Mobile: +46 734 373 822

________________________________

 


The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended solely for the
addressee. If you received this in error, please contact the sender
and delete the material from any computer.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070312/4a995461/attachment.html>


More information about the postgis-users mailing list