Q:

DBeaver how to switch database in sql editor

I'm using DBeaver with Postgres. I can open a new sql editor with ctl+[.
But I have multiple databases in my Postgres. How can I have the sql editor run against another database? the following doesn't work
use <db name>;
select * from <table name>;

A:

You can set a different database as active in your current connection by right-clicking in the Database Navigator pane and selecting "Set active", below I am switching from 'postgres' to my 'report_service' DB
(this is version 6.1.2, not sure about other versions)

EDIT:
I have  recently upgraded to version 6.3.5 and this now has "Set as default" in the dropdown rather than "Set active" but this seems to be roughly the same behaviour

A:

You can change the currently selected database when you create new sql tabs by selecting it from the dropdown.

When you do so be sure to double-click on the schema you want to bring into focus. Then you can open new sql editors with ctrl+].

