Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DBeaver how to switch database in sql editor

Tags:

dbeaver

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>;

dbeaver ui

like image 247
Harry Moreno Avatar asked Feb 22 '19 19:02

Harry Moreno


People also ask

How do you switch databases?

Switching between databases is another way of saying you are closing one connection and opening another. When you need to change between databases, you'll use the “connect” command, which is conveniently shortened to \c, followed by the database name.

How do I change a schema in DBeaver?

To change the active schema, press Ctrl+0 or click the Active Catalog/Schema box in DBeaver`s main toolbar: The Choose catalog/schema dialog box opens.

How do I change my DBeaver connection?

To change the connection type: In the connection properties window, on the General page, click the Connection type field and then click the connection type in the dropdown list: To test the connection, click Test Connection. To confirm the change, click OK.


1 Answers

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)

enter image description here

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

like image 118
DatabaseShouter Avatar answered Sep 20 '22 12:09

DatabaseShouter