Postgres

7 Jan

Install Postgresql on CentOS:


yum install postgresql postgresql-server

Need to edit: /var/lib/pgsql/data/pg_hba.conf, change the file so it looks like:


# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

host all all 10.0.0.0/8 md5 all

host all all 192.168.50.0/24 trust

To dump a database:
pg_dump -Fc my_database > hmm.sql

To restore it:
pg_restore -c -U postgres -d new_database /tmp/hmm.sql

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: