PostgreSQL Tutorial: Access PostgreSQL with DBeaver

October 3, 2023

Summary: DBeaver provides a wizard that guides you through the steps to create a connection. To create a connection, do one of the following:

Table of Contents

DBeaver Installation

The installation process depends on the distribution type and your Operational System, please visit the DBeaver download page to download the corresponding installation package before installation.

Windows / MacOS Installer

The installer distribution is the recommended way to install DBeaver in Windows and MacOS X. It contains all required dependencies. In addition, the installer automatically upgrades DBeaver to the new version if a previous version has already been installed. To install DBeaver, run the installer executable and follow the instructions on its screens.

Note:

  • The installer does not change any system settings or the Java installation.
  • The included JDK will be accessible only to DBeaver.

ZIP Archive

When installing DBeaver manually, without using an installer:

  1. Extract the contents of the archive.

    Note:

    Do not unzip the archive over a previous DBeaver version. If you already have any version of DBeaver extracted in the same location, remove it before unzipping the new version.

    All configurations, scripts and other necessary data are stored in a separate location (usually in the user’s home directory) so the program deinstallation does not affect them.

  2. Run the dbeaver executable.

Create Connection

Use the New Connection Wizard

  • Click the New Connection Wizard button img in the Toolbar or in the Database Navigator view toolbar.

Use the Menu Bar

  • Click Database -> New Database Connection in the menu bar.
  • Press Ctrl+N -> DBeaver. Then, in the wizard, click Database connection and then click Next.
  • Click File -> New -> DBeaver and then, in the wizard, click Database connection and then click Next.

Use the Database Navigator

  • Right-click in the Database Navigator window area and select Create -> Connection.

Using the Create New Connection Wizard

img

To quickly find the needed driver for your database connection, you can:

  • Type a hint in the text field above the list of drivers.
  • Browse the database sections to find the required database.
  • Search for a section using the Search field.
  • Sort the options by Title/Score.

After selecting the required driver, click Next.

Tips

  • If you cannot find a driver for your database, then probably there is no suitable driver, and you need to create one.
  • Within the New Connection Wizard, you can select the project where the database will be saved.

Configuring Connection Settings

In the Connection Settings screen, on the Main tab, you need to set all primary connection settings. Here’s what you typically need to configure:

img

Setting Description
Host The address of the database server.
Port The port number for the connection.
Database Name The name of the specific database you want to connect to.
Username and Password The credentials required for authentication. This falls under the Authentication section, where different databases may use various types of authorizations. Common types include Database Native and DBeaver Profile.

However, the number and type of connection properties are very dependent on the driver. For example, embedded drivers (such as SQLite, Derby Embedded, HSQLDB, H2 Embedded), unlike remote ones, require only the path to the database. For more detailed information about the settings specific to each driver, you can refer to the driver documentation articles available in the DBeaver documentation.

Additional Settings

If necessary, you can specify advanced settings. See the Advanced Settings section below for more details.

Testing and Finalizing the Connection

  • Test the Connection: Click Test Connection to verify if the connection works.
  • Finish: Click Finish. The connection appears in the connections tree in the Database Navigator.

By following these instructions, you can configure and establish a connection to your desired database within DBeaver.

Advanced Settings

The Advanced Settings tab in the connection configuration process provides additional options to fine-tune your connection. Here’s what you can configure:

Network Settings

Setting Description
SSH Tunnel Configure an SSH tunnel if your database requires a secure connection.
SOCKS Proxy Set up a SOCKS proxy if you need to route the connection through a specific proxy server.
SSL Configuration Enable and configure SSL if your connection requires encryption.
Kubernetes Configure Kubernetes settings if your database is hosted within a Kubernetes cluster.

Connection Details (name, type, etc.)

img

Setting Description
Connection Name Assign a specific name to the connection for easier identification. You can use variables in all connection parameters and in the driver properties. Variables are system environment variables or one of the following list:
${host}: Host name
${port}: Port number
${database}: Database name
${server}: Server name
${url}: Connection URL
${user}: User name
${connection.type}: Connection type (e.g., production, development)
${project.name}: Project name
${date}: Current date
${host_or_database}: Host name or database name
Connection Type Choose the type of connection, such as production, development, or test.
Descriptions Add descriptions for your connection for better understanding.
Navigator View Customize the navigator view settings.
Connection Folder Organize your connections by placing them in specific folders.

Note: ${password} property is deprecated due to security concerns since version 23.2.0.

Other Options

Setting Description
Security Enable the Read-only connection checkbox and select Permissions by clicking the Edit Permissions button.
Filters Configure filters for your connection.
Virtual Model Editor Reset virtual model settings, including:
- All virtual constraints and foreign keys.
- All column transformers.
- All table row colorings.
Connection Initialization Settings Customize the initialization settings for your connection.
Shell Commands Configure shell commands for your connection.

These advanced settings allow you to tailor the connection to fit specific requirements and preferences. Be sure to consult your database documentation or system administrator if you need guidance on the appropriate settings for your particular database and use case.

Driver Properties

Each driver has its own set of additional properties. Refer to the driver documentation to get information about available properties and their values. Understanding and configuring these properties can help you optimize the connection according to the specific requirements and behavior of the database driver you are using.

img

See More

Setting up JDBC Driver in DBeaver

Getting Started with PostgreSQL