Postico doesn't show results from last query in transaction.
- Dominant language
- Python
- Stars
- 486
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
When running multiple queries within a transaction I'm seeing the results from the first query instead of the last query which is what I'd expect. For example, when I run the following in postico by highlighting all the code and clicking "Execute Selection" it results in `1`, when I'd expect it to result in `3`
```sql
BEGIN;
SELECT 1;
SELECT 2;
SELECT 3;
END;
```

This does have a real life use case too! I wrote a function that returns a `refcursor`. the cursor only exists within the transaction so I want to fetch from it within the transaction and see the results. I'm essentially doing something like this:
```sql
BEGIN;
SELECT my_function('my_cursor');
FECTH ALL IN my_cursor;
END;
```
If I run both of these examples from the psql command line they print out the result from each query, so I get to see everything. I don't expect postico to show the results from all queries in the transaction, but I think it makes the most sense to show the results from the last query instead of from the first.
Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the Execute Selection entry point and reproduce the transaction with the provided SQL, then compare Postico's displayed result with the psql behavior described in the issue. Done means a transaction containing multiple queries displays the result from the last query, including the refcursor example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- databases, desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100