Back To Normal

Subscribe To Our E-Mail Newsletter

Showing posts with label postgres. Show all posts
Showing posts with label postgres. Show all posts

Thursday, August 7, 2014

How to install postgres in mac

Install postgres in mac by using brew

  • brew install postgres

Want to view info about postgres

  •    brew info postgresql

After installing postgres , better restart your host which will automatically start postgres or you can use following commands to start postgres..

  •     pg_ctl -D /usr/local/var/postgres start
  •     pg_ctl -D /usr/local/var/postgres stop -m fast

Modify config file to set password , if you don’t want to set password then leave it as trust . 

  • file : /usr/local/var/postgres/pg_hba.conf
  • host    all             all             127.0.0.1/32            trust


Just logging with psql and check it 

  •   psql -U postgres

If its thrown error as “Postgres user doesn’t exist” then clean up postgres data by using following commands 


  •   Navigate to file directory :   cd /usr/local/var/
  •   clean up everything : rm -rf *
  •   initdb -U postgres  -D postgres



Read More


Monday, April 22, 2013

Postgres dump and restore commands

Postgres pg dump :
 pg_dump -Upostgres --no-owner --format=tar db_name > db_name_local.tar.dump

Postgres pg restore :
pg_restore -Upostgres --format=tar -d db_name db_name_with_pl.dump.tar



Read More


560 Free Online Courses

Top 200 universities launched 500 free online courses.  Please find the list here .