Showing posts with label postgresql. Show all posts
Showing posts with label postgresql. Show all posts

5/09/2014

Postgresql: getting started

# service postgresql initdb
to create /var/lib/pgsql/data which contains pg_hba.conf

createdb

set password for postgres user

psql -h -d -u -W

11/18/2013

psql: FATAL: Ident authentication failed for user "username" Error and Solution

"By default Postgresql uses IDENT-based authentication. All you have to do is allow username and password based authentication for your network or webserver. IDENT will never allow you to login via -U and -W options. Append following to allow login via localhost only:" (from http://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/)

To access database via tcp connect with username/password, comment this line:
#host    all         all         127.0.0.1/32          ident

10/12/2013

Postgresql Backup and Restore

Backup:
pg_dump db_name > outfile

Restore:
psql db_name < infile