PostgreSQL

From KevinWiki

Revision as of 09:04, 1 August 2010 by Kevin (Talk | contribs)
Jump to: navigation, search


Contents

PostgreSQL

PostgreSQL is an object-relational database management system (ORDBMS).

Installation

  • Install PostgreSQL
$ sudo apt-get install postgresql 

Administration

Setup Root User Password

  • Set up the password of the PostgreSQL root user
$ sudo -u postgres psql postgres 

Welcome to psql 8.3.5, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD 'password'; 

or

postgres=# \password postgres 

Use \quit or \q to quit psql.

postgres=# \q 

Restart Server

To restart the server, /etc/init.d/postgresql-8.x (depending on the version).

sudo /etc/init.d/postgresql-8.4 restart


Install pgAdmin III

$ sudo apt-get install pgadmin3 
Personal tools