Search code examples
dbeaver

Is there a way to find all tables that reference another table/column in DBeaver?


I have a relatively large DBeaver database and am trying to find all tables and possibly columns reference a specific table/column. I can't find anything on SO or anywhere else relating to this question. Any help would be appreciated, thanks.


Solution

  • Feature Support

    Since DBeaver 7.0.0, this has been added as a Major Feature in Table objects (it is major because it exists on any table expandable view).

    Their release notes (github or official page) are not very detailed, unfortunately. However, I will provide an overview of the feature at it is really helpful.

    References - Feature Overview

    Here is a brief overview of how it works:

    1. From Database Navigator go to the table you want
    2. Select the expand icon
    3. Select the References option

    Any references to your table will be listed below. Note that, each table may have zero, one, or more references to your table.

    1. If you just want to get the list of tables (with possible duplicates as mentioned before), you can select all the references, right-click, and from the context menu select Copy Advanced Info. This will copy to your clipboard the references in the following form: [Schema].[OwnerTable].[ReferenceName] from which you can isolate the table names.
    2. Also, a more detailed view is available on double-click References

    References - Demonstration Example

    As a demonstration, I will use one of the most popular sample databases, the Chinook database. It's always freely available on github

    Suppose that you need to know which tables are referencing the table Track.

    From Navigator

    Dbeaver References Demonstration

    Or more detailed view with double click

    Dbeaver References Detailed Demonstration