Thank you all, very useful posts. <br><br><br><div class="gmail_quote">On Tue, Apr 13, 2010 at 9:14 AM,  <span dir="ltr"><<a href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
Hi Vasile,<div class="im"><br><br> createdb -T [template] [name_of_the_database]<br><br></div>This creates a new database in a working Postgres instalation.<br><br>The -T is an optional parameter allowing you to specify a template database to base the new one on. You can create a template database as a custom Postgres database with whatever special facilities you may desire to be automatically provided in a new database you create, by using it as the template. You do not need to use this to create a Postgis database (but you can if you so desire)<br>
<br>For example just use createdb dbname to create a new database called dbname.<br><br>A Postgres database newly created without specifyinfg a suitable custom template will not have support for the plpgsql language installed in the database. Postgis is basically written in this language, so you need to add it to the Postgres database
 before adding Postgis, using  createlang plpgsql [database]<br><br>You can add Postgis without running  <br><div class="im">psql -d [database] -f
/usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql<br></div>but generally I would not. This command creates a table in the Postgis database called spatial_ref_sys, which contains information about standard projections to enable Postgis to transform (reproject) spatial objects from one datum/projection to another. <br>
<br>These steps (along with  psql -d [database] -f
/usr/share/postgresql/8.4/contrib/postgis.sql)<br>will create a Postgis, or spatially enabled Postgres database which is capable of storing, querying & manipulating spatial objects (geometries), but will not create any geometries in the database. You have the facilities to manage spatial data, but have not yet added any such data to the new database.<br>
<br>The documentation available at <a href="http://www.postgis.org" target="_blank">www.postgis.org</a> is a good place to start, and various books also provide information on using Postgis, including:<br><br><a href="http://www.amazon.com/Web-Mapping-Illustrated-Source-Toolkits/dp/0596008651/ref=sr_1_1?ie=UTF8&s=books&qid=1271142583&sr=1-1" target="_blank">Web Mapping Illustrated: Using Open Source GIS Toolkits</a> <span>by <a href="http://www.amazon.com/Tyler-Mitchell/e/B001IXUH7Y/ref=sr_ntt_srch_lnk_1?_encoding=UTF8&qid=1271142583&sr=1-1" target="_blank">Tyler Mitchell</a></span><span><br>
</span><a href="http://www.amazon.com/PostGIS-Action-Regina/dp/1935182269/ref=sr_1_2?ie=UTF8&s=books&qid=1271142583&sr=1-2" target="_blank">PostGIS in Action</a> <span>by Regina and Leo Hsu</span><span> (being written)</span><br>
<div><a href="http://www.amazon.com/Beginning-MapServer-Source-Development-Experts/dp/1590594908/ref=sr_1_3?ie=UTF8&s=books&qid=1271142583&sr=1-3" target="_blank"> </a></div>
<div>
  
  
  
  <div><a href="http://www.amazon.com/Beginning-MapServer-Source-Development-Experts/dp/1590594908/ref=sr_1_3?ie=UTF8&s=books&qid=1271142583&sr=1-3" target="_blank"> Beginning MapServer: Open Source GIS Development</a> by Bill Kropla<br>
<a href="http://www.amazon.com/Desktop-GIS-Mapping-Planet-Source/dp/1934356069/ref=sr_1_6?ie=UTF8&s=books&qid=1271142583&sr=1-6" target="_blank">Desktop GIS: Mapping the Planet with Open Source Tools</a> <span>by <a href="http://www.amazon.com/Gary-Sherman/e/B002BMKE8I/ref=sr_ntt_srch_lnk_6?_encoding=UTF8&qid=1271142583&sr=1-6" target="_blank">Gary Sherman</a></span><br>
</div></div><a href="http://www.amazon.com/Approaches-Handling-Advances-Geographic-Information/dp/354074830X/ref=sr_1_9?ie=UTF8&s=books&qid=1271142583&sr=1-9" target="_blank">Open Source Approaches in Spatial Data Handling (Advances in Geographic Information Science)</a> <span>by Brent Hall and Michael G. Leahy</span><span></span><br>
<br>HTH,<br><br>  Brent Wood<br><br>--- On <b>Fri, 4/9/10, Vasile Cristian Stan <i><<a href="mailto:vasileestan@gmail.com" target="_blank">vasileestan@gmail.com</a>></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">
<br>From: Vasile Cristian Stan <<a href="mailto:vasileestan@gmail.com" target="_blank">vasileestan@gmail.com</a>><div class="im"><br>Subject: [postgis-users] steps in creating a new database<br>To: <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
</div>Date: Friday, April 9, 2010, 10:10 PM<div><div></div><div class="h5"><br><br><div>Hi all,<br><br><br>I try to create a new postgis database on Ubuntu, and I'm quite confused about the steps in creating a database.<br>
<br><br>Creating database:<br># createdb -T [template] [name_of_the_database]<br><br>
- what are the use [-T] and [template] in this line <br>- I can create my own template? for example: # createdb -T [general_data] [world]<br><br>


         
        
         
        

<p style="margin-bottom: 0in;">Adding plpsql language to the database:</p><p style="margin-bottom: 0in;">


         
        
         
        

</p><p style="margin-bottom: 0in;"># createlang plpgsql [database]</p><p style="margin-bottom: 0in;">


         
        
         
        

</p><p style="margin-bottom: 0in;"># psql -d [database] -f
/usr/share/postgresql/8.4/contrib/postgis.sql</p>

<p style="margin-bottom: 0in;"># psql -d [database] -f
/usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql</p>

<p style="margin-bottom: 0in;"># psql -d [database] -c"select
postgis_lib_version();"</p>
<p></p>
<p></p>
<br>- is plpgsql a condition in creating a geodatabase<br>- what's happening if I don't add this line # psql -d [database] -f
/usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql<br><br>- This are the complete steps in creating a spatial database? <br>- Where i can find more information regarding this subject?<br><br><br>Thank you, <br>Cristian<br>

<br>
</div><br></div></div>-----Inline Attachment Follows-----<br><br><div>_______________________________________________<br>postgis-users mailing list<div class="im"><br><a href="http://mc/compose?to=postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
</div><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></blockquote></td></tr></tbody></table></blockquote>
</div><br>