Changes between Version 1 and Version 2 of UsersWikiPostGIS21UbuntuPGSQL93Apt
- Timestamp:
- 12/09/13 15:04:50 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsersWikiPostGIS21UbuntuPGSQL93Apt
v1 v2 7 7 Run in terminal: 8 8 9 {{{sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list'}}} 9 {{{ 10 sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list' 11 }}} 10 12 11 {{{wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -}}} 13 {{{ 14 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - 15 }}} 12 16 13 {{{sudo apt-get update}}} 17 {{{ 18 sudo apt-get update 19 }}} 14 20 15 21 == Install == 16 The following will install postgresql 9.3, PostGIS, PGAdmin3, and additional supplied modules including {{{adminpack}}}22 The following will install postgresql 9.3, PostGIS, PGAdmin3, and additional supplied modules including '''adminpack''' 17 23 18 {{{sudo apt-get install postgresql-9.3-postgis pgadmin3 postgresql-contrib}}} 24 {{{ 25 sudo apt-get install Postgresql-9.3-postgis pgadmin3 postgresql-contrib 26 }}} 19 27 20 28 == Enable Adminpack == … … 22 30 While in terminal, log in to psql as postgres user: 23 31 24 {{{sudo -u postgres psql}}} 32 {{{ 33 sudo -u postgres psql 34 }}} 25 35 26 {{{CREATE EXTENSION adminpack;}}} 36 {{{ 37 CREATE EXTENSION adminpack; 38 }}} 27 39 28 40 Quit psql: 29 41 30 {{{\q}}} 42 {{{ 43 \q 44 }}} 31 45 32 46 == Create new PGSQL user == … … 36 50 While in terminal, run: 37 51 38 {{{sudo su - postgres}}} 52 {{{ 53 sudo su - postgres 54 }}} 39 55 40 {{{createuser -d -E -i -l -P -r -s yourUserName}}} (be sure to change the username to your desired username) 56 {{{ 57 createuser -d -E -i -l -P -r -s yourUserName 58 }}} 59 60 (be sure to change the username to your desired username) 41 61 42 62 Enter your new password when prompted 43 63 44 Log out as {{{postgres}}} user: 64 Log out as {{{ 65 postgres 66 }}} user: 45 67 46 {{{exit}}} 68 {{{ 69 exit 70 }}} 47 71 48 72 Exit terminal: 49 73 50 {{{exit}}} 74 {{{ 75 exit 76 }}} 51 77 52 78 == Use PGAdmin to log into database server == … … 73 99 Right-click the extensions node, and click {{{new extension}}} 74 100 75 Enable the {{{postgis}}} extension, as well as {{{postgis_topology}}}101 Enable the '''postgis''' extension, as well as '''postgis_topology''' 76 102 77 == Testshp2pgsql-gui ==103 == Import SHP files using shp2pgsql-gui == 78 104 79 Another handy piece of software to use is the{{{shp2pgsql-gui}}} tool. This will allow you to quickly connect to your new PostGIS database and import a Shapefile.105 Another handy piece of software {{{shp2pgsql-gui}}} tool. This will allow you to quickly connect to your new PostGIS database and import a Shapefile. 80 106 81 107 Open terminal, and type: 82 108 83 {{{shp2pgsql-gui}}} 109 {{{ 110 shp2pgsql-gui 111 }}} 84 112 85 113 Follow the on-screen prompts to load your data.