Last active
December 9, 2019 15:24
-
-
Save adamshamsudeen/072c7e73ef4e5db8c9c4d95f1ef50ece to your computer and use it in GitHub Desktop.
postgress setup on ubuntu for django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libpq-dev postgresql postgresql-contrib | |
sudo -u postgres -i | |
psql | |
create database tagger; | |
create user tagger_user with password 'passsss'; | |
grant all privileges on database tagger to tagger_user; | |
ALTER ROLE tagger_user SET client_encoding TO 'utf8'; | |
ALTER ROLE tagger_user SET default_transaction_isolation TO 'read committed'; | |
ALTER ROLE tagger_user SET timezone TO 'UTC'; | |
sudo -u postgres psql tagger -c "GRANT ALL ON ALL TABLES IN SCHEMA public to tagger_user;" | |
sudo -u postgres psql tagger -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public to tagger_user;" | |
sudo -u postgres psql tagger -c "GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to tagger_user;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To give access to the db
/etc/postgresql/9.3/main
You have to edit postgresql.conf file and change line with 'listen_addresses'.
listen_addresses = '*'
then added to top of directives in pg_hba.conf file
host all all 0.0.0.0/0 md5
Restart psql