I dont know if it's a bug or a misunderstanding of the gui.
I have a postgresql database with one table dataimport. I open dbeaver, set active the database, run a select on the table without problem. If I open a new sql editor and run the same query, I get "relation dataimport does not exist".
The new editor doesnt seem to be connected to the right database ???
dbeaver-debug.log
2017-02-24 12:26:04.051 - DBeaver 4.0.0 is starting
2017-02-24 12:26:04.062 - Install path: '/usr/share/dbeaver'
2017-02-24 12:26:04.062 - Instance path: 'file:/home/christophe/.dbeaver4/'
2017-02-24 12:26:04.063 - Memory available 75Mb/871Mb
2017-02-24 12:26:04.094 - Starting RMI server at 64462
2017-02-24 12:26:04.348 - Create display
2017-02-24 12:26:04.439 - Run workbench
2017-02-24 12:26:08.476 - Initializing DBeaver 4.0.0
2017-02-24 12:26:08.493 - Host plugin: org.jkiss.dbeaver.core.application 4.0.0
2017-02-24 12:26:08.505 - Initialize Core...
2017-02-24 12:26:09.005 - Core initialized (500ms)
2017-02-24 12:26:09.013 - Configure workbench window
2017-02-24 12:26:09.211 - Create actions
2017-02-24 12:26:09.220 - Disable Eclipse action set 'org.eclipse.ui.edit.text.actionSet.annotationNavigation'
2017-02-24 12:26:09.224 - Disable Eclipse action set 'org.eclipse.ui.edit.text.actionSet.navigation'
2017-02-24 12:26:09.230 - Disable Eclipse action set 'org.eclipse.ui.WorkingSetActionSet'
2017-02-24 12:26:09.980 - Initialize workbench window
2017-02-24 12:26:10.071 - Finish initialization
2017-02-24 12:26:12.700 - Connect with 'narvalo' (postgres-jdbc-15a386bc619-7c48af1750a3062)
2017-02-24 12:26:13.423 - Connected (postgres-jdbc-15a386bc619-7c48af1750a3062)
2017-02-24 12:26:55.798 - null
org.jkiss.dbeaver.model.exec.DBCException: SQL Error [42P01]: ERROR: relation "dataimport" does not exist
Position: 15
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:140)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:343)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:707)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:1752)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "dataimport" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:344)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:137)
... 6 more
2017-02-24 12:30:15.432 - null
org.jkiss.dbeaver.model.exec.DBCException: SQL Error [42P01]: ERROR: relation "dataimport" does not exist
Position: 15
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:140)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:343)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:707)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:1752)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "dataimport" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:344)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:137)
... 6 more
.log
!SESSION 2017-02-24 12:26:01.644 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.jkiss.dbeaver.model 4 0 2017-02-24 12:26:55.813
!MESSAGE SQL Error [42P01]: ERROR: relation "dataimport" does not exist
Position: 15
!STACK 0
org.jkiss.dbeaver.model.exec.DBCException: SQL Error [42P01]: ERROR: relation "dataimport" does not exist
Position: 15
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:140)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:343)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:707)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:1752)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "dataimport" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:344)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:137)
... 6 more
!SUBENTRY 1 org.jkiss.dbeaver.model 4 0 2017-02-24 12:26:55.814
!MESSAGE ERROR: relation "dataimport" does not exist
Position: 15
!STACK 0
org.postgresql.util.PSQLException: ERROR: relation "dataimport" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:344)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:137)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:343)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:707)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:1752)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY org.jkiss.dbeaver.model 4 0 2017-02-24 12:30:15.448
!MESSAGE SQL Error [42P01]: ERROR: relation "dataimport" does not exist
Position: 15
!STACK 0
org.jkiss.dbeaver.model.exec.DBCException: SQL Error [42P01]: ERROR: relation "dataimport" does not exist
Position: 15
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:140)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:343)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:707)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:1752)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "dataimport" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:344)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:137)
... 6 more
!SUBENTRY 1 org.jkiss.dbeaver.model 4 0 2017-02-24 12:30:15.448
!MESSAGE ERROR: relation "dataimport" does not exist
Position: 15
!STACK 0
org.postgresql.util.PSQLException: ERROR: relation "dataimport" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:344)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:137)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:343)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:707)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:1752)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Upgrade to 4.0.1. There was a bug with search_path update in 4.0.
same issue with 4.0.1
Can't reproduce.
SET search_path query. Check that it is correct.Thanks for your help.
In the query manager without filters, I can't see any SET search_path query
I am not sure it's a search_path problem, SELECT current_database() returns 'postgres', which is not the active database
You need to run SELECT current_schema().
You can't change active database without full reconnect. While current schema can be changed at any moment.
Sorry I dont understand. I dont want to change the active database (I change it once after launch because postgres is the default active database). The only thing I want is open another sql editor on the same database.
The behaviour on my machine is very weird. It seems that new editors are connected to the postgres database, not the active database. I am sorry not being able to give you more debug info.
Well, let's clear the PostgreSQL terms:
postgres.In DBeaver you may work only with active PG database (marked with bold in navigator tree). All SQL editors will be connected with this database.
But you may easily change active schema.
I have several databases, one of them is 'tmp', in the schema 'public' of 'tmp' there is a table dataimport. The database 'tmp' is active, and one editor (script-2) is working fine, but not the other one (script-1) because current_database='postgres'
Despite this problem, dbeaver is great!
Now it is clear. Yep, seems to be a bug, thanks for details.
Thanks a lot Serge.
I wonder if it is not possible to "use this bug" in some way to allow connections to different postgresql databases (without using set active) ?
You can just configure another connection (with another database name)
I have the same plroblem with new updated version 5.1.6.2
@ovisem Could you post exact error message/log? It can't be exactly the same.
Hi, this from the log file: !SESSION 2018-09-07 08:34:27.186 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_181
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.jkiss.dbeaver.model 2 0 2018-09-07 08:34:33.414
!MESSAGE Datasource provider 'wmi' not found. Bad provider description.
!ENTRY org.jkiss.dbeaver.model 4 0 2018-09-07 08:36:20.479
!MESSAGE SQL Error [42P01]: ERROR: relation "t_document" does not exist
Position: 16
!SUBENTRY 1 org.jkiss.dbeaver.model 4 0 2018-09-07 08:36:20.479
!MESSAGE ERROR: relation "t_document" does not exist
Position: 16
!STACK 0
org.postgresql.util.PSQLException: ERROR: relation "t_document" does not exist
Position: 16
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2427)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2169)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:341)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:134)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeStatement(SQLQueryJob.java:445)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.lambda$0(SQLQueryJob.java:389)
at org.jkiss.dbeaver.model.DBUtils.tryExecuteRecover(DBUtils.java:1559)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:387)
at org.jkiss.dbeaver.runtime.sql.SQLQueryJob.extractData(SQLQueryJob.java:819)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:2346)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:93)
at org.jkiss.dbeaver.model.DBUtils.tryExecuteRecover(DBUtils.java:1559)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:95)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Thank you
This issue was resolved in recent version. You also could try EA version (https://dbeaver.io/files/ea)
My version is 5.1.6.201808262133
Yep. Sorry, by "recent" I meant Early Access.
Anyhow, new version will be released on Monday.
Version 5.1.2 and this issue still exists
Yes, still exists and for me. 馃様
@hellgorithm @ovisem Could you describe this issue a bit more?
I've fixed active database switch in SQL editor (when "Open separate connection" option is on) and can't reproduce this problem anymore.
So maybe your problem is different.
At me version of PostgresSQL it's 9.5.14 on Linux
I mean some details about your SQL.
In which schema t_document located?
What is your current schema?
Could you try to use fully qualified table name - does it work?
My structure is database.schema.table
I try with fully qualified name and doesn't work.
Maybe your active database differs from the one you are trying to query.
Try to run
SELECT current_database()
and
SELECT current_schema()
to check. Is DBeaver active database (the bold one in navigator tree) is the same as PG current_database()?
I checked, it's the same as in navigator tree.
The error is happening with some tables not with all tables from DB. For other tables it works for others not.
Same issue persists in 5.2.1 as of today. Let me know if you need my logs.
I'm quite sure this is a different problem than was originally described in this ticket.
Some additional info would be helpful, as well as the new ticket.
Screenshot with database navigator tree, main toolbar and sql editor will help a lot. Gif movie would be awesome.
For me, it helped to change the connection configuration. I had 3 DBs in the same connection: [postgres, rdsadmin, interview]. I was interested in always connecting to interview, so by changing the database name from posgres to interview in the connection configuration, i was able to work with the correct db.
Feel free to delete this comment if it is not useful, but I came here with this issue, and was able to solve it this way.
Thanks for dbeaver! :)
I resolved this issue by changing the database name in the connection as by default, it executes on the postgres DB.
This is a typical confusing thing about PG connections.
In db navigator you can see all databases (by default) but only one of them is active (it is bold).
When you write your queries in SQL editor they may operate only with schemas/tables in the active database. You need to switch to another database (right click->Set active) to be able to query it.
Agreed, this is not very obvious. But this is how PostgreSQL database works.
Do you have any ideas how to handle this better in UI?
Try Ctrl+0
In select Instance choose your correct instance
and select the public schema of your instance.
That's all folks!
@serge-rider
Do you have any ideas how to handle this better in UI?
Yes, I suggest to set the database active as soon as you click on it. The current way "right click->Set active" is really not obvious.
Most helpful comment
This is a typical confusing thing about PG connections.
In db navigator you can see all databases (by default) but only one of them is active (it is bold).
When you write your queries in SQL editor they may operate only with schemas/tables in the active database. You need to switch to another database (right click->Set active) to be able to query it.
Agreed, this is not very obvious. But this is how PostgreSQL database works.
Do you have any ideas how to handle this better in UI?