<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html >
<head>
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<title>populating a table</title>
<style>
<!--
font-face
{font-family:Tahoma;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:#606420;
text-decoration:underline;}
p
{
margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{
font-family:Arial;
color:navy;}
span.EmailStyle20
{
font-family:Arial;
color:navy;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink="#606420">
<DIV id=idOWAReplyText61973 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>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.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Do you remember how you installed the old
database and what events happened before your old one stopped
working?</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>First thing to check is to see if you have
a template_postgis database or something of that sort. </FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>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</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Next bet</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>If you are running PostGreSQL on
WinXP, then you can try out one of the Windows PostGIS installers found
here.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><A
href="http://postgis.refractions.net/download/windows/">http://postgis.refractions.net/download/windows/</A></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Hope that helps,</DIV>
<DIV dir=ltr>Regina</DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net on behalf of Malm
Paul<BR><B>Sent:</B> Mon 3/12/2007 10:05 AM<BR><B>To:</B> PostGIS Users
Discussion<BR><B>Subject:</B> RE: [postgis-users] populating a
table<BR></FONT><BR></DIV>
<DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I did
</SPAN></FONT><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">createlang plpgsql
yourtestdatabase: and got an answer that it was already
installed</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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).</SPAN></FONT><FONT face=Arial
color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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…
</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Could you please attach
the sql files in a mail (if you got the time and patience).</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Kind
regards,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">/Paul
</SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Obe, Regina<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> den 12 mars 2007 13:54<BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> PostGIS Users Discussion<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [postgis-users] populating a
table</SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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.</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">createlang plpgsql
yourtestdatabase <BR>psql -d yourtestdatabase -f lwpostgis.sql <BR>psql -d
yourtestdatabase -f spatial_ref_sys.sql </SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">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.</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Malm Paul<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, March 12, 2007 8:42
AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> PostGIS Users
Discussion<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE:
[postgis-users] populating a table</SPAN></FONT></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Yes it is a new
database, I can also see that the </SPAN></FONT><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">AddGeometryColumn has a green
underscore<FONT color=navy><SPAN style="COLOR: navy"> in the SQL window in
pgadmin: </SPAN></FONT>SELECT
<U>AddGeometryColumn</U>('public','h1707640_cul_transl','the_geom','-1','MULTILINESTRING',2);</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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?</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks!</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Paul</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Obe, Regina<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> den 12 mars 2007 13:22<BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> PostGIS Users Discussion<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [postgis-users] populating a
table</SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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.</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Other possibility is
that you have the addgeometrycolumn function, but it is not in your default
schema or one of your search schemas.</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Malm Paul<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, March 12, 2007 8:13
AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
postgis-users@postgis.refractions.net<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [postgis-users] populating a
table</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi!</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This has worked before, could anyone
please tell me what’s wrong?</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m
trying to create and populate a Table in my database with a script</SPAN></FONT>
<FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">generated with</SPAN></FONT> <FONT
face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">shp2pgsql.exe SQL:</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">BEGIN;</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">CREATE TABLE
"public"."h1707640_cul_transl" (gid serial PRIMARY KEY,</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN lang=SV
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"f_code"
varchar(5),</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN lang=SV
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"f_code_des"
varchar(254),</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"exs" int2,</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"exs_descri"
varchar(254),</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"tile_id" int2,</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"edg_id" int4,</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"shape_leng"
numeric);</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">SELECT
AddGeometryColumn('public','h1707640_cul_transl','the_geom','-1','MULTILINESTRING',2);</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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');</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">END;</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m
getting the following error message:</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">NOTICE: CREATE TABLE will
create implicit sequence "h1707640_cul_transl_gid_seq" for serial column
"h1707640_cul_transl.gid"</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">NOTICE: CREATE TABLE / PRIMARY
KEY will create implicit index "h1707640_cul_transl_pkey" for table
"h1707640_cul_transl"</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ERROR: function
addgeometrycolumn("unknown", "unknown", "unknown", "unknown", "unknown",
integer) does not exist</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">SQL
state: 42883</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hint: No function matches the given
name and argument types. You may need to add explicit type
casts.</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Character: 225</SPAN></FONT></P>
<P><A name=""></A><B><FONT face=Arial size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">Paul
Malm</SPAN></FONT></B></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Saab Systems, Naval Systems
Division</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Tel: +46 8 580 838
22</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Mobile</SPAN></FONT><FONT face=Arial
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">: +46 734 373
822</SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR align=center width="100%" SIZE=1>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P><B><FONT face="Times New Roman" size=3><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 12pt"><BR><STRONG><B><FONT
face="Times New Roman">The substance of this message, including any attachments,
may be</FONT></B></STRONG><BR><STRONG><B><FONT
face="Times New Roman">confidential, legally privileged and/or exempt from
disclosure</FONT></B></STRONG><BR><STRONG><B><FONT
face="Times New Roman">pursuant to Massachusetts law. It is intended solely for
the</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">addressee. If
you received this in error, please contact the
sender</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">and delete
the material from any
computer.</FONT></B></STRONG></SPAN></FONT></B></P></DIV></DIV>
</body>
</html>