Feedback
Did this article resolve your question/issue?

   

Article

PostgreSQL driver does not support Catalog Names

Information

 
TitlePostgreSQL driver does not support Catalog Names
URL Name4907
Article Number000126717
EnvironmentProduct: Connect/Connect64 for ODBC PostgreSQL Wire Protocol driver
Version: 6.0 and higher
OS: All supported platforms
Database: PostgreSQL
Application: All ODBC applications
Question/Problem Description
Using the Connect for ODBC PostgreSQL Wire Protocol driver v 6.0, the above error is received on a SQLForeignKeys call on a table with a foreign key.
SQLTables using non-null Catalog names returns an error with the DataDirect PostgreSQL ODBC driver
Cannot load Schema with DataDirect PostgreSQL driver
Steps to ReproduceSteps to Reproduce:
1. Create the following tables:
CREATE TABLE M4PRUEBA_LONG1 (ID_PK1 VARCHAR(30) CONSTRAINT NN_IDPK_PRU1 NOT NULL, LONG_INFO1 LONG NULL, CONSTRAINT PK_PRU1 PRIMARY KEY (ID_PK1))
CREATE TABLE M4PRUEBA_LONG2 (ID_PK2 VARCHAR(30) CONSTRAINT NN_IDPK_PRU2 NOT NULL, LONG_INFO2 LONG NULL, CONSTRAINT PK_PRU2 PRIMARY KEY (ID_PK2))

2. call SQLForeignKeys and specify a Catalog Name
Clarifying Information
Using .NET to ODBC bridge
C# code snippet
var restrictions = new string[] { DatabaseName, null, null };
var schemaData = conn.GetSchema(OdbcMetaDataCollectionNames.Tables, restrictions);


The .NET call is then converted to the below ODBC SQLTables call

ENTER SQLTablesW
    HSTMT               0x000002476DBBCA20
    WCHAR *             0x0000024700094E8C [       4] "DatabaseName"
    SWORD                        4
    WCHAR *             0x0000000000000000 <null pointer>
    SWORD                        0
    WCHAR *             0x0000000000000000 <null pointer>
    SWORD                        0
    WCHAR *             0x000002470017CAB4 [      18] "TABLE,SYSTEM TABLE"
    SWORD                       18

 

Error Message[DataDirect][ODBC PostgreSQL Wire Protocol driver]The qualifier 'test' was larger than SQL_MAX_QUALIFIER_LEN from SQLGetInfo (0).
Defect NumberEnhancement
Enhancement Number
Cause
The Connect for ODBC PostgreSQL Wire Protocol driver currently does not support Catalog Names.
Resolution
It was determined that the Progress Product is functioning as designed.

An enhancement to the product can be requested through the Progress Community via an Ideas submission. Customer feedback is valuable and Idea submissions are monitored by our Product Management team. Enhancement requests are reviewed during the planning phase of each new product release and a list of the enhancements chosen for implementation can be found in the Release Notes documents that accompany each release. Once an Idea is submitted the Progress Software Community will have the opportunity to comment on and vote for the Idea.

For detailed information on how to submit an Idea, please refer to Knowledge Base article How to submit an idea for a Progress product enhancement.
Workaround
Do not specify a Catalog Name in the SQLTables call.

In the .NET code, remove the schema restrictions specified in the GetSchema call using one of the below code snippets
 
var restrictions = new string[] { null, null, null };
var schemaData = conn.GetSchema(OdbcMetaDataCollectionNames.Tables, restrictions);
OR
//var restrictions = new string[] { DatabaseName, null, null }; //comment out the restrictions
var schemaData = conn.GetSchema(OdbcMetaDataCollectionNames.Tables); //remove the restrictions from the GetSchema call

 
Notes
Last Modified Date11/20/2020 6:58 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.