1. Install PostgreSQL on macOS
Using Homebrew:
- Update Homebrew:
brew update- Install PostgreSQL:
brew install postgresql- Start PostgreSQL:
brew services start postgresql- Verify Installation:
psql --versionTo Connect to PostgreSQL:
psql postgres2. Install PostgreSQL on Ubuntu/Debian
- Update Package List:
sudo apt update- Install PostgreSQL:
sudo apt install postgresql postgresql-contrib- Check PostgreSQL Service:
PostgreSQL starts automatically; to check the status:
sudo systemctl status postgresql- Verify Installation:
psql --versionTo Connect to PostgreSQL:
sudo -u postgres psql3. Install PostgreSQL on Windows
- Download Installer:
Go to the PostgreSQL website and download the installer.
- Run the Installer:
- Launch the installer and follow the instructions.
- Select Command Line Tools during the installation process.
- Verify Installation:
After installation, open a Command Prompt and type:
psql --versionTo Connect to PostgreSQL:
- Open the
psqlcommand line interface from the Start menu or use:
psql -U postgres- Enter the password you set during installation.
4. Post-Installation Tips
- Create a Database:
CREATE DATABASE mydatabase;- List Databases:
\l- Connect to a Database:
\c mydatabase- Exit psql:
\qThis guide should get PostgreSQL up and running on your system!
Discussion 0
Please sign in to join the discussion.
No comments yet. Start the discussion!