don't raise a generic "something went wrong" exception but instead
ensure that the original exception with the proper error message
is raised for catching in Python instead
Fixes#38092 by adding an optional QgsFeedback argument to
the executeSql method and by implementing the PQCancel
method in the PG provider internals.
While the cancellation works well for all supported provider while
fetching results in the loop, the cancellation of a running query is now
implemented for the postgres provider connection only because the GPKG
and GDAL both rely on GDALDatasetExecuteSQL which cannot be interrupted.
This PR also introduce a few optimizations in the PG DB-Manager
code that should probably fix also other "slowness" issues that
were reported after 3.x during PG query execution.
A small UX change in th SQL dialog makes it evident to the user that
a cancellation request has been sent to the backend: the button text
is changed to "Cancellation requested, please wait..." so that for
provider connections that are not able to interrupt the running query
and must wait for the fetching loop to exit from the exeuteSql call
the user knows that something is happening and that a cancellation
request has been successfully sent.
When saving a raster expression the generated expression didn't contain square brackets around the letters used for band identifiers. Sticking with the NDVI example:
```
("NIR@1" - "Red@1") / ("NIR@1" + "Red@1")
```
becomes
```
(a - b) / (a + b)
```
Due to the way the expression is parsed these would not be interactie parameters for the user to set as the parameters requre square brackets around the layer tags. This change simply updates the string replacement to include the square brackets so you would get instead:
```
([a] - [b]) / ([a] + [b])
```
Line 120 : "FieldPyculator code execute error.Global code block can't be executed!\n{0}\n{1}" " should probably be
"FieldPyculator code execute error. Global code block can't be executed!\n{0}\n{1}" "
Added one space bewteen "error." and "Gobal"