How to Connect PostgreSQL to DBeaver

Galaxy Glossary

How do I connect a PostgreSQL database in DBeaver?

Create a new PostgreSQL connection in DBeaver using the built-in JDBC driver and a valid connection string.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

What prerequisites must be met?

Install DBeaver (Community or Enterprise), ensure PostgreSQL is running and accessible, and have the host, port, database name, username, and password ready.

How do I open the PostgreSQL connection wizard?

From DBeaver’s main window, click New Connection (plug icon). In the list of drivers, select PostgreSQL and press Next.

Which fields must I fill in?

Enter Host, Port (default 5432), Database, User, and Password.Leave Driver as the bundled PostgreSQL JDBC driver unless you need a custom version.

What is the exact JDBC URL syntax?

Use jdbc:postgresql://<host>:<port>/<database>. Advanced parameters (SSL, timeouts) go after a ?. Example appears below.

How can I test and save the connection?

Click Test Connection. If successful, press Finish. DBeaver stores the profile and opens a new SQL editor tab.

How do I run a sample ecommerce query?

In the editor, paste the example query and hit Ctrl + Enter (Cmd + Enter on macOS).Results appear in the grid, ready for filtering or export.

What are best practices for secure connections?

Enable SSL in the driver properties, avoid saving plaintext passwords by using DBeaver’s secure storage, and grant the connecting role read-only privileges when possible.

How do I share the connection with teammates?

Right-click the connection, choose Generate SQL > DDL to export driver properties, or share the .dbeaver-data-sources.xml entry along with passwords kept out of SCM.

.

Why How to Connect PostgreSQL to DBeaver is important

How to Connect PostgreSQL to DBeaver Example Usage


-- List customers with their order count
SELECT c.name,
       COUNT(o.id) AS total_orders
FROM   Customers  c
JOIN   Orders     o ON o.customer_id = c.id
GROUP  BY c.name
ORDER  BY total_orders DESC;

How to Connect PostgreSQL to DBeaver Syntax


jdbc:postgresql://<host>:<port>/<database>[?property1=value1&property2=value2]

-- Minimal example
a. Host: db.company.com
b. Port: 5432
c. Database: shop

JDBC URL:
jdbc:postgresql://db.company.com:5432/shop?user=app_user&password=S3cr3t

DBeaver fields:
Driver : PostgreSQL
Host   : db.company.com
Port   : 5432
Database : shop
Username : app_user
Password : ••••••••

Common Mistakes

Frequently Asked Questions (FAQs)

Can I use SSH tunneling?

Yes. In the connection settings, open the SSH tab, enable Use SSH Tunnel, and supply the bastion host, port, user, and private key.

How do I switch databases after connecting?

Right-click the connection > Edit Connection > Main tab and change the Database field, or open a new connection with the desired DB.

Why does DBeaver ask to download drivers?

The first time you select PostgreSQL, DBeaver fetches the latest compatible JDBC driver. Approve the download; it occurs once per version.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.