View primary key in DBeaver

hunger picture hunger · Feb 11, 2019 · Viewed 7.7k times · Source

Is there a quick way to view the primary key of a table in DBeaver? Like e.g. in the Eclipse data source explorer, where primary key rows are marked with "PK" and a special symbol.

Eclipse data source explorer

Answer

Anshuman Tiwari picture Anshuman Tiwari · Jun 24, 2019

For a given table, right click on the table name(in Database Navigator) -> select View Diagram.

This will open a window like this containing a single ER Diagram for the table - enter image description here

In this diagram, the primary keys can be seen marked as bold under the table name, in the second partition.

To have a look at the primary keys of all the tables, in the Database Navigator, go to your database and then right click on public -> select View diagram. This will open the ER diagram for the whole database and the connections between the tables. Here, under each table name, the bold columns are the primary keys.

Note: A primary key can be a single key as well as a combination of multiple keys.