Last active
August 27, 2021 08:40
-
-
Save 3h5a9/f9e388509335e618f50273540d518ae9 to your computer and use it in GitHub Desktop.
Install PostgreSQL latest version on Elementary OS
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
Install | |
------------------ | |
sudo apt-get install curl ca-certificates gnupg && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
sudo apt update && sudo apt-get install postgresql-12 | |
Create a new user | |
------------------ | |
sudo -u postgres createuser -D -A -P username | |
Create database | |
------------------ | |
sudo -u postgres createdb --owner=username databasename | |
Accessing PostgreSQL | |
------------------ | |
sudo -u postgres psql | |
Change user to SUPERUSER | |
------------------ | |
ALTER USER username WITH SUPERUSER; | |
SOURCE: [https://computingforgeeks.com/install-postgresql-12-on-ubuntu/] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment