PostgreSQL: Create database, connect and list (command line)

Changing host configuration
$ vi /var/lib/pgsql/8.4/data/pg_hba.conf

Add postgresql to startup process
$ chkconfig postgresql-8.4 on

Start postgresql service
$ service postgresql-8.4 start

Access postgresql
$ su – postgresql
$ psql

Create database
postgres-# create database test

List databases
postgres-# \list

Exit postgresql
postgres-# \q (or \quit)

Connect to database
postgres-# \c test (\connect test)

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
How to install PostgreSQL on CentOS Linux?

First lets do an update before we start installing PostgreSQL $ yum update You can install PostgreSQL from CentOS Base...

Close