Skip to content

Instantly share code, notes, and snippets.

@rplaurindo
Last active November 24, 2016 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rplaurindo/cb673111a655303167df to your computer and use it in GitHub Desktop.
Save rplaurindo/cb673111a655303167df to your computer and use it in GitHub Desktop.

Working with PostgresSQL

Requirements

  • libpq-dev

Installing

$ sudo apt-get install -fy postgresql

Obs.: the files ~/.pgpass must have permission only for owner. And, for you change permission, you must be the owner of this file.

$ chmod 0600 ~/.pgpass

Settings

If necessary for authentication, change the file /etc/postgresql/<version>/main/pg_hba.conf in the line that contains:

local   all             postgres                                peer

to

local   all             postgres                                md5

Alter password to default user

$ sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" 

Restart server

$ sudo service postgresql reload

Reinstalling the postgresql package

If necessary you reinstall the postgresql.

$ sudo apt-get --reinstall install postgresql

Installing the DBSM PGAdmin

$ sudo apt-get install -fy pgadmin3

Setting Up PGAdmin

Name: something

Host: localhost (of a remote host address)

Password: chosen when you run ALTER USER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment