<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>populating a table</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 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
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink="#606420">

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I did </span></font><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>createlang plpgsql yourtestdatabase: and got an answer that it was already
installed<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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 size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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… <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Could you please attach the sql files in a
mail (if you got the time and patience).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Kind regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>/Paul <o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Courier New"><span style='font-size:12.0pt;
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><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Courier New"><span style='font-size:12.0pt;
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><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;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><st1:PersonName
w:st="on">Malm Paul</st1:PersonName><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><o:p></o:p></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Yes it is a new database, I can also see that the </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;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);<o:p></o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;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?<o:p></o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thanks!<o:p></o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Paul</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;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><st1:PersonName w:st="on">Malm
 Paul</st1:PersonName><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><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><!-- Converted from text/rtf format -->Hi!</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>This
has worked before, could anyone please tell me what’s wrong?</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I’m
trying to create and populate a Table in my database with a script</span></font>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>generated
with</span></font> <font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>shp2pgsql.exe SQL:</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>BEGIN;</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>CREATE
TABLE "public"."h1707640_cul_transl" (gid serial PRIMARY
KEY,</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span lang=SV style='font-size:10.0pt;font-family:
Arial'>"f_code" varchar(5),</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span lang=SV style='font-size:10.0pt;font-family:
Arial'>"f_code_des" varchar(254),</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>"exs"
int2,</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>"exs_descri"
varchar(254),</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>"tile_id"
int2,</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>"edg_id"
int4,</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>"shape_leng"
numeric);</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>SELECT
AddGeometryColumn('public','h1707640_cul_transl','the_geom','-1','MULTILINESTRING',2);</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;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><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>END;</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I’m
getting the following error message:</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>NOTICE: 
CREATE TABLE will create implicit sequence
"h1707640_cul_transl_gid_seq" for serial column
"h1707640_cul_transl.gid"</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>NOTICE: 
CREATE TABLE / PRIMARY KEY will create implicit index
"h1707640_cul_transl_pkey" for table "h1707640_cul_transl"</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>ERROR:
function addgeometrycolumn("unknown", "unknown",
"unknown", "unknown", "unknown", integer) does
not exist</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>SQL
state: 42883</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hint:
No function matches the given name and argument types. You may need to add
explicit type casts.</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Character:
225</span></font><o:p></o:p></p>

<p><a name=""></a><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>Paul Malm</span></font></b><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Saab
Systems, Naval Systems Division</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Tel:
+46 8 580 838 22</span></font><o:p></o:p></p>

<p><st1:place w:st="on"><st1:City w:st="on"><font size=2 face=Arial><span
  style='font-size:10.0pt;font-family:Arial'>Mobile</span></font></st1:City></st1:place><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>: +46 734
373 822</span></font><o:p></o:p></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=1 width="100%" align=center>

</span></font></div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt;
font-weight:bold'><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 <st1:State w:st="on"><st1:place
 w:st="on">Massachusetts</st1:place></st1:State> 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><o:p></o:p></p>

</div>

</body>

</html>