question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PostgreSQL how to work with multiple DB from one connection?

See original GitHub issue

Hello. I’m not very proficient with DBs, just using for work. Sorry that can’t give any technical details.

Before 3.6 I used to check all available DBs on the server in pgadmin and then connect in dbeaver to the correct one.

pgadmin — with these parameters I could see all schemes and execute queries on their tables:

  • maintenance db: postgres
  • login/password: postgres

For example, I need DB named “db1” (where all data are stored within “db1sm” scheme). Before 3.6 my connection in dbeaver would be:

  • db: db1
  • login/password: db1_rw

Now in 3.6 I assumed the behavior would be similar to pgadmin, and used its parameters (postgres). I can see now all DBs on the server, but when I want to look at schemes/tables for “db1” I get: org.jkiss.dbeaver.DBException: DBException: Can't access non-default database . OKAY. So I click “Set Active”. But nevertheless I can’t see the most important scheme of DB — “db1sm”. I can see it only if I connect with login/password for this DB. But then, I can’t use the same connection to work with other DBs — their lists of schemes all shows “db1sm” instead of their own. 219

My point:

  1. Is it normal that within one connection I can work only with one DB? Because “Set active” deactivates previously active DB.
  2. For all main schemes within DBs we have corresponding users. In pgadmin I can connect under “postgres” and do anything without restriction. In dbeaver3.6 to see the scheme in question I must connect by the scheme user. So to work with DBs I forced to created multiple connections again, like in previous dbeaver version.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
serge-ridercommented, Feb 24, 2016

Multi-database access is not yet supported in DBeaver. You can access only the default database (the one specified in the connection properties). This is pretty complicated issue because PostgreSQL requires separate network connection for each database. Multi-database feature is tracked in #34.

2reactions
serge-ridercommented, Jul 15, 2016

Just make multiple connections (in Database Navigator view) with the same server address but different database names. You may copy/paste connections to simplify the process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

postgresql - Joining Results from Two Separate Databases
Create a foreign server object, using CREATE SERVER , to represent each remote database you want to connect to. Specify connection information, except...
Read more >
4 Methods for joining data from multiple PostgreSQL databases
Around since ever, this method might easily be the simplest way to join independent Postgres databases. Basically you just need to create the ......
Read more >
15: 36.2. Managing Database Connections - PostgreSQL
One connects to a database using the following statement: EXEC SQL CONNECT TO target [AS connection-name ] [USER user-name ];. The target can...
Read more >
PostgreSQL: support several databases in one Data Source
Currently, one Postgres Data Source in DataGrip can work with one database only. This problem is because a Postgres JDBC connection has no...
Read more >
Listing Databases and Tables in PostgreSQL Using psql
A single Postgres server process can manage multiple databases at the same time. Each database is stored as a separate set of files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found