Skip to main content

How to Connect SQL Developer to PostgreSQL

Set up a PostgreSQL connection in SQL Developer in just a few clicks. No complex configuration required - the PostgreSQL driver is built-in.

Connect to PostgreSQL database

Before You Start

What you'll need

  • SQL Developer installed (download free)
  • PostgreSQL server running and accessible
  • Connection details: hostname, port, username, password, database name

Good news: Unlike MySQL, you don't need to download a separate JDBC driver. SQL Developer includes PostgreSQL support out of the box.

Connect to PostgreSQL Step by Step

Follow these steps to set up your connection

1

Open Connection Dialog

Click the green + icon in the Connections panel on the left side of SQL Developer. This opens the New Database Connection dialog.

2

Select PostgreSQL

In the connection dialog, click the PostgreSQL tab on the left side. The form will update to show PostgreSQL-specific fields.

3

Enter Connection Details

Connection Name: Any name (e.g., "My Postgres DB")
Username: postgres (or your user)
Password: Your password
Hostname: localhost or server IP
Port: 5432 (default)
Database: postgres (or your DB name)

4

Test and Connect

Click Test to verify the connection works. If successful, click Save then Connect.

PostgreSQL Connection Examples

Common configurations for different setups

Local PostgreSQL

Hostname: localhost
Port: 5432
Database: postgres
Username: postgres

Heroku Postgres

Hostname: ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com
Port: 5432
Database: (from Heroku dashboard)
Username: (from Heroku dashboard)
SSL: Required

Amazon RDS PostgreSQL

Hostname: your-instance.xxxx.region.rds.amazonaws.com
Port: 5432
Database: postgres
Username: your_master_user

DigitalOcean Managed Database

Hostname: your-db-do-user-xxxxx-0.db.ondigitalocean.com
Port: 25060
Database: defaultdb
SSL: Required

PostgreSQL Connection Troubleshooting

Fix common connection problems

!

Connection Refused

PostgreSQL isn't accepting connections. Check that the service is running:
sudo systemctl status postgresql
Also verify pg_hba.conf allows your connection.

!

FATAL: password authentication failed

Wrong password or username. PostgreSQL usernames are case-sensitive. Try resetting the password:
ALTER USER postgres PASSWORD 'newpass';

!

FATAL: no pg_hba.conf entry

PostgreSQL is rejecting your IP. Edit pg_hba.conf and add:
host all all 0.0.0.0/0 md5
Then restart PostgreSQL.

Better Than pgAdmin?

Try SQL Developer - one tool for PostgreSQL, MySQL, Oracle, and more. Free forever.