PostgreSQL
From KevinWiki
(Difference between revisions)
(New page: Category:Linux ==PostgreSQL== [http://en.wikipedia.org/wiki/PostgreSQL PostgreSQL] is an object-relational database management system (ORDBMS). ==Installation== *Install PostgreSQL <...) |
|||
Line 10: | Line 10: | ||
</pre> | </pre> | ||
- | + | ==Administration== | |
+ | ===Setup Root User Password=== | ||
*Set up the password of the PostgreSQL root user | *Set up the password of the PostgreSQL root user | ||
$ sudo -u postgres psql postgres | $ sudo -u postgres psql postgres | ||
Line 23: | Line 24: | ||
postgres=# '''ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';''' | postgres=# '''ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';''' | ||
- | postgres=# '''\q''' | + | or |
+ | postgres=# '''\password postgres''' | ||
+ | |||
+ | Use <code>\quit</code> or <code>\q</code> 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== | |
<pre> | <pre> | ||
$ sudo apt-get install pgadmin3 | $ sudo apt-get install pgadmin3 | ||
</pre> | </pre> |
Revision as of 09:04, 1 August 2010
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