I have created a cursor-based stored proc in Redshift according to the aws docs sample at https://docs.aws.amazon.com/redshift/latest/dg/stored-procedure-result-set.html. However, when calling it using the datagrip console using the following sql:-
FETCH ALL FROM mycursor;
I receive the error [Amazon](500310) Invalid operation: cursor "mycursor" does not exist;.
If I try the exact same execution sql in sqlworkbench/j build 124, it runs successfully and i get the expected table of results. Curiously, it does fail in sqlworkbench/j build 125 with this error and also in the AWS Redshift query editor. I think what may be happening here is some kind of autocommit and so the cursor goes out of scope as soon as the call statement completes and thus "does not exist" by the time the fetch all statement is reached.
Is this somthing that can be fixed in datagrip or is this a low level driver thing that I can't get at?