Showing posts with label postgre. Show all posts
Showing posts with label postgre. Show all posts

Wednesday, September 21, 2022

Backup Restore Postgresql

** backup **

[enter password utk postgres -- bila perlu]

root#passwd postgres

[enter password]

root#su postgres

postgres# pg_dump -W -F t idempiere > /tmp/idempiere.tar

exit


** restore **

root#su postgres

postgres#psql  --masuk psql

postgres# drop database idempiere

postgres# create database idempiere

postgres# exit ---dari psql

postgres# pg_restore --dbname=idempiere < /tmp/idempiere.tar

exit

** selesai **

Wednesday, June 13, 2012

Postgre accept remote connection

1.cari /postgresql/data/pg_hba.conf
2.# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD

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

3. tambahi
host    all         all         0.0.0.0/0 trust

4.ubah postgresql.conf
dari:
#listen_addresses='localhost'
menjadi
listen_addresses='*'

kelemahan: semua IP dpt connect