Babelfish for PostgreSQL provides the capability for PostgreSQL to work with applications written for Microsoft SQL Server. Babelfish understands the SQL Server wire-protocol and T-SQL, the Microsoft SQL Server query and procedural language, so you don’t have to switch database drivers or rewrite all of your application queries.
But is appeared that table_type parameter handling in MSSQL is more relaxed. For example, the following query is sent by IBM Cognos Analytics application, it is likely be passed through mssql-jdbc impl of JDBC getTables introspection method:
Current Babelfish handling of table_type with unnest(string_to_array(table_type, ',')) seems to be too strict, it is suggested to relax it to accepts strings with invalid quotation that are accepted by MSSQL.
Version
BABEL_3_X_DEV (Default)
Extension
babelfishpg_tsql (Default)
Which flavor of Linux are you using when you see the bug?
Fedora
Relevant log output
No response
Code of Conduct
[X] I agree to follow this project's Code of Conduct.
What happened?
With
sp_tables
procedure Babelfish supports table_type parameter, for example the following call will return both tables and view:But is appeared that
table_type
parameter handling in MSSQL is more relaxed. For example, the following query is sent by IBM Cognos Analytics application, it is likely be passed through mssql-jdbc impl of JDBC getTables introspection method:This "double-escaped" query returns empty results in Babelfish.
Besides this double-quoted example, MSSQL also accepts
table_type
with unbalanced quotes like this:Current Babelfish handling of
table_type
withunnest(string_to_array(table_type, ','))
seems to be too strict, it is suggested to relax it to accepts strings with invalid quotation that are accepted by MSSQL.Version
BABEL_3_X_DEV (Default)
Extension
babelfishpg_tsql (Default)
Which flavor of Linux are you using when you see the bug?
Fedora
Relevant log output
No response
Code of Conduct