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>;
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With