RE: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

Xuesong Gao

Hi,

 

We wrote our application that acts as a pseudo PostgreSQL server and we use PsqlODBC as client. Our table names are very long so we set it to 255. Our server actively sends this to client after password using parameter status message, it also returns 255 when client call “show max_identifier_length”.

 

Based my test, SQLGetInfo does return 255 when parameter is SQL_MAX_TABLE_NAME_LEN, SQL_MAX_IDENTIFIER_LEN, etc. However, the table name is still truncated to 127 characters in SQLTables call. And I can tell that our server does return full length of table name (>128 chars) using Wireshark.

 

Thanks,

Song Gao


mylog_odbct32w_14504.log (178K) Download Attachment
psqlodbc_odbct32w_14504.log (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

Inoue, Hiroshi-2
Hi,

I would examine the issue.

regards,
Hiroshi Inoue

On 2019/08/09 13:37, Xuesong Gao wrote:

Hi,

 

We wrote our application that acts as a pseudo PostgreSQL server and we use PsqlODBC as client. Our table names are very long so we set it to 255. Our server actively sends this to client after password using parameter status message, it also returns 255 when client call “show max_identifier_length”.

 

Based my test, SQLGetInfo does return 255 when parameter is SQL_MAX_TABLE_NAME_LEN, SQL_MAX_IDENTIFIER_LEN, etc. However, the table name is still truncated to 127 characters in SQLTables call. And I can tell that our server does return full length of table name (>128 chars) using Wireshark.

 

Thanks,

Song Gao



ウイルス フリー。 www.avg.com
Reply | Threaded
Open this post in threaded view
|

Re: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

Inoue, Hiroshi-2
Could you please try the test drivers on Windows 11.00.0300 at
https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue

On 2019/08/10 9:57, Inoue, Hiroshi wrote:
Hi,

I would examine the issue.

regards,
Hiroshi Inoue

On 2019/08/09 13:37, Xuesong Gao wrote:

Hi,

 

We wrote our application that acts as a pseudo PostgreSQL server and we use PsqlODBC as client. Our table names are very long so we set it to 255. Our server actively sends this to client after password using parameter status message, it also returns 255 when client call “show max_identifier_length”.

 

Based my test, SQLGetInfo does return 255 when parameter is SQL_MAX_TABLE_NAME_LEN, SQL_MAX_IDENTIFIER_LEN, etc. However, the table name is still truncated to 127 characters in SQLTables call. And I can tell that our server does return full length of table name (>128 chars) using Wireshark.

 

Thanks,

Song Gao


ウイルス フリー。 www.avg.com
Reply | Threaded
Open this post in threaded view
|

RE: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

Xuesong Gao

It works!

 

Do you keep your GitHub source code up-to-date? We took version 09.06 and customized it, added a load database button (so that users can browse instead of type in) for example. So I would like to merge your changes to our version.

 

Here is what our driver looks like, and I can share my code with you if you want to add load databases function.

 

 

Thanks,

Song Gao

 

From: Inoue, Hiroshi [mailto:[hidden email]]
Sent: Tuesday, August 13, 2019 8:11 AM
To: Xuesong Gao <[hidden email]>
Cc: [hidden email]
Subject: Re: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

 

Could you please try the test drivers on Windows 11.00.0300 at
https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue

On 2019/08/10 9:57, Inoue, Hiroshi wrote:

Hi,

I would examine the issue.

regards,
Hiroshi Inoue

On 2019/08/09 13:37, Xuesong Gao wrote:

Hi,

 

We wrote our application that acts as a pseudo PostgreSQL server and we use PsqlODBC as client. Our table names are very long so we set it to 255. Our server actively sends this to client after password using parameter status message, it also returns 255 when client call “show max_identifier_length”.

 

Based my test, SQLGetInfo does return 255 when parameter is SQL_MAX_TABLE_NAME_LEN, SQL_MAX_IDENTIFIER_LEN, etc. However, the table name is still truncated to 127 characters in SQLTables call. And I can tell that our server does return full length of table name (>128 chars) using Wireshark.

 

Thanks,

Song Gao

 

ウイルス フリー。 www.avg.com

 

Reply | Threaded
Open this post in threaded view
|

Re: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

Inoue, Hiroshi-2
Hi,

Sorry for the late reply.
I have changed my local branch but wouldn't push it to git at once.

Instead I attached the simplest fix for your system.
Please try the patch.

regards,
Hiroshi Inoue

On 2019/08/13 23:11, Xuesong Gao wrote:

It works!

 

Do you keep your GitHub source code up-to-date? We took version 09.06 and customized it, added a load database button (so that users can browse instead of type in) for example. So I would like to merge your changes to our version.

 

Here is what our driver looks like, and I can share my code with you if you want to add load databases function.

 

 

Thanks,

Song Gao

 

From: Inoue, Hiroshi [[hidden email]]
Sent: Tuesday, August 13, 2019 8:11 AM
To: Xuesong Gao [hidden email]
Cc: [hidden email]
Subject: Re: psqlodbc - table name is truncated to 127 characters even SQL_MAX_TABLE_NAME_LEN is set to 255

 

Could you please try the test drivers on Windows 11.00.0300 at
https://winpg.jp/~inoue/psqlodbc/index.html
?

regards,
Hiroshi Inoue

On 2019/08/10 9:57, Inoue, Hiroshi wrote:

Hi,

I would examine the issue.

regards,
Hiroshi Inoue

On 2019/08/09 13:37, Xuesong Gao wrote:

Hi,

 

We wrote our application that acts as a pseudo PostgreSQL server and we use PsqlODBC as client. Our table names are very long so we set it to 255. Our server actively sends this to client after password using parameter status message, it also returns 255 when client call “show max_identifier_length”.

 

Based my test, SQLGetInfo does return 255 when parameter is SQL_MAX_TABLE_NAME_LEN, SQL_MAX_IDENTIFIER_LEN, etc. However, the table name is still truncated to 127 characters in SQLTables call. And I can tell that our server does return full length of table name (>128 chars) using Wireshark.

 

Thanks,

Song Gao


ウイルス フリー。 www.avg.com

psqlodbc.patch (772 bytes) Download Attachment