sudo apt-get update
sudo apt-get install apt-utils
sudo apt-get install -y postgresql postgresql-contrib
psql --verison
sudo service postgresql # status for checking the status of your database.
sudo service postgresql # start to start running your database.
sudo service postgresql stop # stop running a db
sudo service postgresql start
sudo service postgresql start
sudo -u postgres psql
# uninstall
apt-get purge postgresql*
sudo apt-get autoremove
# List all PG related packages
dpkg -l | grep postgres
# Remove Folders
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
# Switch over to the postgres account on your server
sudo -i -u postgres
# Accessing a Postgres Prompt Without Switching Accounts
sudo -u postgres psql
Created
October 7, 2022 15:48
-
-
Save rsstdd/399cd22df463649d8c9c50da2a6d610b to your computer and use it in GitHub Desktop.
Linux PSQL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment