Enhancement - Query Tool - Run SQL Code From non-contiguous highlighted code blocks
In the SQL window of the Query Tool, if I highlight a block of SQL, PGADMIN4 will try to run just the SQL within the highlighted block. This is a very useful debugging tool to isolate and debug subqueries of a larger query,
In the Windows operating system I can highlight a second block of code by holding down the CTRL key while I click and drag the mouse over that second block. However, PGAdmin4 will only try to run the last block you highlighted, not all blocks together. Here is an (considerably simplified) example that illustrates the issue:
Here is a simple, somewhat nonsensical Union query that utilizes a Common Table Expression. It runs without error in my Query Tool window of PGAdmin4 ver. 8.4 executing PostgreSQL ver. 16.
If I highlight the last line and try to run I, of course, get an error because the CTE definition is not included:
Now if I hold down the CTRL key and click-drag the mouse over the CTE code, I get a second highlighted area. Taken together, these two blocks are valid SQL code and should run without error, but it does not - I get the same error:
Notice that the error says it occurred on line 1 - the topmost block of text was not included for the execution.
If I copy this to the clipboard and paste it into a new blank Query Tool window, both blocks come over correctly and the code executes correctly.