PostgreSQL : "Tools/Execute script" on a database => executed on the wrong database
See original GitHub issueSystem information:
- Operating system (distribution) and version : Windows 10
- DBeaver version : 6.3.3
- Additional extensions : none
Connection specification:
- Database name and version : PostgreSQL
- Driver name : PostgreSQL JDBC Driver
- Do you use tunnels or proxies (SSH, SOCKS, etc)? No
Describe the problem you’re observing:
Since upgrading to DBeaver 6.3.2 and 6.3.3, scripts are not executed on the selected database, but on another database. I have several databases on the same PostgreSQL server, and I want to execute a script on each of the databases :
- Right click on the initial database (database_dev), and select Tools/execute script : window open, OK
- Select the script and run it : script run, OK
- Right click on another database (database_prod), and select Tools/execute script : window open, OK
- Select the script and run it : script run on the other database, and the log is incoherent :
C:\Users\nvervell\AppData\Roaming\DBeaverData\drivers\clients\postgresql\win\psql.exe --host=my-host-postgresql.postgres.database.azure.com --port=5432 --username=user@my-host-postgresql --echo-errors database_dev
Task 'PostgreSQL script' started at Tue Jan 21 12:32:02 CET 2020
...
Task 'PostgreSQL script' finished at Tue Jan 21 12:32:08 CET 2020
2020-01-21 12:32:09.047 - Initiate connection to PostgreSQL database [user@my-host-postgresql.postgres.database.azure.com] for Main <database_prod>
2020-01-21 12:32:09.614 - Initiate connection to PostgreSQL database [user@my-host-postgresql.postgres.database.azure.com] for Metadata <database_prod>
As you can see, at the beginning of the log the command ends with “database_dev” (while I selected “database_prod” as the target), but at the end of the log it says “database_prod”.
It was working properly before the upgrade (I was using DBeaver 6.2.x), and I changed nothing in the configuration. I tried to create a separate connection for each database, rather than using the same connection, but nothing changed.
Steps to reproduce, if exist:
Include any warning/errors/backtraces from the logs
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Documentation: 15: psql - PostgreSQL
When program is specified, command is executed by psql and the data passed from or to command is routed between the server and...
Read more >Run a PostgreSQL .sql file using command line arguments
If the database is remote, use the same command with host ... Use this to execute *.sql files when the PostgreSQL server is...
Read more >2 Using SQL Scripts
You can cut and paste a SQL command from the SQL Script editor to run it in SQL Commands. ... See "Managing Database...
Read more >sp_execute_external_script (Transact-SQL) - SQL Server
Requires EXECUTE ANY EXTERNAL SCRIPT database permission. Examples. This section contains examples of how this stored procedure can be used to ...
Read more >Run queries | DataGrip Documentation - JetBrains
Open the Files tool window (View | Tool Windows | Files) and double-click ... In order to run SQL scripts, treat the usages...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With previous versions, it wasn’t depending on the active DB : using the contextual menu (Tools / Execute script) on a DB would run the script on this DB, whether or not it’s the active DB.
verified