Open GitMensch opened 2 years ago
This raises a somewhat interesting point: in PostgresQL DEALLOCATE
is used to explicitly deallocate a preparate statement. In SQL Server it is used to deallocate a cursor. While there is currently no driver for it, SQL Server could still be reached with an ODBC connection, so I guess the second solution is not possible.
I will think how I can work my way around it.
There is actually no need to work around it. PostgreSQL itself forces the statement name to lowercase, as with all identifiers (I had a look in the pg_prepared_statements
view), so we can apply your proposed solution #1 and force all to lowercase as well.
The only problem could be when using quoted identifiers for prepared statements (PostgreSQL, as usual, doesn't modify them) but I guess that is such a corner case that one could apply a restriction (i.e. "please don't do that").
It seems like e62e34c did "something" for this but did not add any new testsuite entries. Are those missing or can they be closed?
EXECL SQL PREPARE S1 FROM :command
then open + fetch + close
EXECL SQL DEALLOCATE PREPARE S1
--> results in return code -106, PG complaining about "s1 not prepared".
changing the code to use all lower-case "s1" works.
The reason: the first statements are processed by GixSQL and S1 is passed "as is". The last statement is directly passed to the DB and parsed there "as sql" - and in this process converted to "all lower-case".
Two possible solutions:
stmt_name
before it is passed to the DB (this may be PG specific and needs to be upper-cased or can be ignored with other DBs..)DEALLOCATE PREPARE X
likePREPARE X FROM
is handledWorkaround for PG in the meantime: change all prepared statement names in all COBOL source to lower-case.