Text arrays fails with MaxVarCharSize > 16383 - Mailing list pgsql-odbc
From | Åsmund Kveim Lie |
---|---|
Subject | Text arrays fails with MaxVarCharSize > 16383 |
Date | |
Msg-id | 4422C3ED.7020800@nosyko.no Whole thread Raw |
List | pgsql-odbc |
Hi all, I have encountered a strange problem when using text arrays and setting MaxVarCharSize > 16383 (or -4). The data does not get received through the ODBC and the log shows a strange error. It appears that it tries to convert the array to an SQL_C_BINARY (log attached). To recreate the problem I created a small test table: CREATE TABLE test (c text[]); INSERT INTO test(c) VALUES ('{"Hello world"}'); And through my (Windows) app I selected * from test. When having MaxVarCharSize <= 16383 it works and I get ‘{“Hello world”}’ back, but setting it to –4 (unlimited length) or > 16383 I get an empty string and an error in the log. I’m using PostgreSQL 8.1.3 and ODBC 08.01.0200. Best regards, Åsmund Kveim Lie conn = 70531576, PGAPI_Connect(DSN='rofus', UID='asmundkl', PWD='xxxxx') Global Options: Version='08.01.0200', fetch=100, socket=0, unknown_sizes=254, max_varchar_size=16384, max_longvarchar_size=70532984 disable_optimizer=1, ksqo=1, unique_index=1, use_declarefetch=0 text_as_longvarchar=1, unknowns_as_longvarchar=1, bools_as_char=1 NAMEDATALEN=64 extra_systable_prefixes='dd_;', conn_settings='' conn_encoding='OTHER' conn=70531576, query='select version()' [ PostgreSQL version string = 'PostgreSQL 8.1.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 20060212 (prerelease)(Debian 4.0.2-9)' ] [ PostgreSQL version number = '8.1' ] conn=70531576, query='set DateStyle to 'ISO'' conn=70531576, query='set geqo to 'OFF'' conn=70531576, query='set extra_float_digits to 2' conn=70531576, query='select oid from pg_type where typname='lo'' conn=70531576, query='select pg_client_encoding()' conn=70531576, query='set client_encoding to 'latin9'' CONN ERROR: func=PGAPI_SetConnectOption, desc='fOption=1041, vParam=16632476', errnum=205, sqlstate=, errmsg='Unknown connectoption (Set)' ------------------------------------------------------------ henv=70524728, conn=70531576, status=1, num_stmts=16 CONN ERROR: func=PGAPI_SetConnectOption, desc='fOption=1042, vParam=16632476', errnum=205, sqlstate=, errmsg='Unknown connectoption (Set)' ------------------------------------------------------------ henv=70524728, conn=70531576, status=1, num_stmts=16 conn=70531576, query='SELECT version()' conn=70531576, query='SELECT c FROM test' couldn't convert the type 1009 to SQL_C_BINARY STATEMENT ERROR: func=PGAPI_GetData, desc='', errnum=14, sqlstate=, errmsg='Received an unsupported type from Postgres.' ------------------------------------------------------------ hdbc=70531576, stmt=70543848, result=70557728 manual_result=1, prepare=0, internal=0 bindings=70559208, bindings_allocated=1 parameters=0, parameters_allocated=0 statement_type=0, statement='SELECT c FROM test' stmt_with_params='SELECT c FROM test' data_at_exec=-1, current_exec_param=-1, put_data=0 currTuple=0, current_col=0, lobj_fd=-1 maxRows=0, rowset_size=1, keyset_size=0, cursor_type=3, scroll_concurrency=1 cursor_name='SQL_CUR043469E8' ----------------QResult Info ------------------------------- fields=70557880, manual_tuples=70558176, backend_tuples=70558384, tupleField=0, conn=70531576 fetch_count=101, num_total_rows=0, num_fields=1, cursor='(NULL)' message='(NULL)', command='SELECT c FROM test', notice='(NULL)' status=2, inTuples=1 CONN ERROR: func=PGAPI_GetData, desc='', errnum=0, sqlstate=, errmsg='(NULL)' ------------------------------------------------------------ henv=70524728, conn=70531576, status=1, num_stmts=16 conn=70531576, PGAPI_Disconnect
pgsql-odbc by date: