Last active
January 31, 2020 16:09
-
-
Save layik/86f70308762414d7d89b8fb3fcbae9ca to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
apt update | |
# install on Ubuntu | |
apt-get install postgresql postgresql-contrib -y | |
# there is now a postgres user in /etc/passwd | |
# easy way to start it | |
service postgresql start | |
# now everything should be done as 'postgres' userr | |
su - postgres -c "createdb django" | |
# list databases for instance | |
su - postgres -c "psql -c '\l'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That should work on both Ubuntu and Debian.
Tested on Docker "ubuntu" and "python"