Message-ID: From: "davecramer (@davecramer)" To: "postgresql-interfaces/psqlodbc" Date: Mon, 16 Jun 2025 10:30:59 +0000 Subject: Re: [postgresql-interfaces/psqlodbc] issue #98: SELECT of a PostgreSQL CHAR/VARCHAR/TEXT Column Using multiple calls SQLGetData results in data truncation (last byte) In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 2976015573 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 98 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/issues/98#issuecomment-2976015573 Content-Type: text/plain; charset=utf-8 I cannot reproduce the issue. ``` create table public.rantexttab(textcol text); CREATE TABLE test=# insert into public.rantexttab values(repeat('A', 1048000) || 'BB'); INSERT 0 1 test=# select length(textcol) from public.rantexttab; length --------- 1048002 (1 row) ``` ``` diff pglob.cpp ~/Downloads/pglob.cpp.txt 48,52c48,51 < ret = SQLConnect(hdlDbc, < (SQLCHAR*) "psqlodbc_test_dsn", SQL_NTS, < (SQLCHAR*) "test", SQL_NTS, < (SQLCHAR*)"test", SQL_NTS); < --- > const char* dsnName = "pg16"; > const char* userID = "postgres"; > const char* passwd = "postgres"; > ret = SQLConnect(hdlDbc, (SQLCHAR*)dsnName, SQL_NTS,(SQLCHAR*)userID,SQL_NTS, (SQLCHAR*)passwd, SQL_NTS); ``` Here is the output from my run ``` ./pglob Connecting to database. Connected to database. Fetching results... First Call to GetData: ind : 1048002 Data: AAAAAAAAAA� Second Call to GetData: ind : 1047992 Data: AAAAAAAAAA� Free handles. ```