Saturday, 5 June 2021

Postgres - hosting - recover

 If you want to make copy of postgres database


1 login as postgres user - sudo -su postgres


if in case permission denied go to 

cd /var/lib/postgresql/

2 pg_dump -d NAME_OF_DATABASE -f data.sql


your data is store in /var/lib/postgresql