Changes between Version 10 and Version 11 of UsersWikiPostGIS20Ubuntu1204

Show
Ignore:
Timestamp:
05/05/12 22:29:04 (13 months ago)
Author:
jeffmeyer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Ubuntu1204

    v10 v11  
    4040Install prerequisite packages using: 
    4141{{{ 
    42 sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev xsltproc docbook-xsl docbook-mathml gettext 
     42sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev xsltproc docbook-xsl docbook-mathml gettext pgadmin3 
    4343}}} 
    4444 
     
    113113}}} 
    114114 
    115  
    116 == Spatially-enable a database == 
     115== Connecting to your new database == 
     116 
     117There are two primary ways to connect to your new database from the localhost, one is to use the pgadmin tool, the other is to use the psql command line tool. Remote connections via IP are left as exercises for the more advanced user. 
     118 
     119In either case, you'll need to connect to the database using your 'postgres' user account, which was created during installation of PostgreSQL.   
     120What in the world is the password for this account? Who knows? I haven't been able to figure it out. Luckily, there are instructions on what to do at: https://help.ubuntu.com/community/PostgreSQL. 
     121 
     122An important distinction to make when getting started is that there are both a system user account named 'postgres' '''and''' a database account named 'postgres'. These are two separate accounts. The database allows psql-based command line connections from the localhost by system user accounts with the '''same username''' as the database account. Make sense? Bottom line is that  you won't be able to do much at all until you set up the password for both of these accounts, separately. 
     123 
     124Note that some online documentation recommends setting up a system user account called 'postgres' with superuser privileges, but this is not a requirement for getting started. 
     125 
     126Next steps - start logged in as your user account 
     127{{{ 
     128$ sudo passwd postgres 
     129Enter new UNIX password:  
     130Retype new UNIX password:  
     131passwd: password updated successfully 
     132$ sudo -s -u postgres 
     133postgres$ psql 
     134psql (9.1.3) 
     135Type "help" for help. 
     136 
     137postgres=# \password postgres 
     138Enter new password:  
     139Enter it again:  
     140postgres=# \q 
     141postgres$  
     142}}} 
     143 
     144If you're going to want to connect to the PostgreSQL database using your own account (so you don't have to fool around with 'postgres'), you may want to do this: 
     145 
     146{{{ 
     147 
     148}}} 
     149 
     150Now, you should be able to 
     151 
     152If you connect through pgadmin, use the following attributes: 
     153 * Name: this is an arbitrary name for your database server 
     154 * Host: localhost 
     155 * Port: 5432 [pre-filled as default] 
     156 * Service:       [leave this blank] 
     157 * Maintenance DB: postgres [default] 
     158 * Username: postgres 
     159 * Password: whatever you set in the prior step 
     160 * Store password: uncheck this (or not, based on your security paranoia level) 
     161 * Colour: whatever suits your fancy 
     162 * Group: Servers [default] 
     163 
     164 
     165 
     166== Spatially-enabling a database == 
    117167With PostgreSQL 9.1, there are two methods to add PostGIS functionality to a database: using extensions, or using enabler scripts. 
    118168