Dump a PostgreSQL database:

postgres@server:~$ pg_dump db_name -v --format=c --file=./db_name.dump

Import the dump to a new PostgreSQL database:

postgres@server:~$ createdb -E UTF8 -T template0 db_new
postgres@server:~$ pg_restore -U user -d db_new ./db_name.dump
postgres@server:~$ psql --command "ALTER DATABASE db_new OWNER TO user;"

PostgreSQL, often basically Postgres, is an object-relational database management method (ORDBMS) obtainable for lots of platforms including Debian , FreeBSD, Solaris, MS Windows & Mac OS X.

It is released under the PostgreSQL License, which is an MIT-style license, & is thus free & open source application. PostgreSQL is developed by the PostgreSQL Global Development Group, consisting of a handful of community volunteers employed & supervised by companies such as Red Hat.

Step1. PostgreSQL Installation:

apt-get install postgresql

Step2. PostgreSQL Configuration:

The main configuration file is located in : /etc/postgresql/8.4/main/postgresql.conf
Fist open the configuration file and make the following changes:

vim /etc/postgresql/8.4/main/postgresql.conf

and remove the “#” form  line:

#password_encryption = on

Optional you can make the PostgreSQL to listen on  any ip address:

Continue Reading…

Page 1 of 11