Skip to content

Instantly share code, notes, and snippets.

@aissam-en
Created August 7, 2024 12:05
Show Gist options
  • Save aissam-en/0c34091cc2c14fd34e0d9eb0a9a47e74 to your computer and use it in GitHub Desktop.
Save aissam-en/0c34091cc2c14fd34e0d9eb0a9a47e74 to your computer and use it in GitHub Desktop.
install postgresql ubuntu server
  • install postgreSQL
sudo apt install postgresql
  • set password :
     sudo -u postgres psql template1
     ALTER USER postgres with encrypted password 'my_passwordy';
     \q
  • create a database :
     sudo -i -u postgres
     psql
     CREATE DATABASE my_db;
     \q
     exit
  • check the version :
    pg_lsclusters
# or :
    sudo -i -u postgres
    psql
    SELECT version();
    \q
# or : 
    dpkg -l | grep postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment