X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3FA839DCAD6 for ; Thu, 23 Mar 2006 11:52:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56945-02 for ; Thu, 23 Mar 2006 11:52:10 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B18B89DCAA2 for ; Thu, 23 Mar 2006 11:52:03 -0400 (AST) Received: from db.nosyko.no (db.nosyko.no [193.213.210.38]) by svr4.postgresql.org (Postfix) with SMTP id 3D0B05AF8BF for ; Thu, 23 Mar 2006 15:52:06 +0000 (GMT) Received: from lurker.nosyko.no ([192.168.20.6] helo=[127.0.0.1]) by db.nosyko.no with esmtp (Exim 4.50) id 1FMS6Q-0002Yp-MA for pgsql-odbc@postgresql.org; Thu, 23 Mar 2006 16:51:59 +0100 Message-ID: <4422C3ED.7020800@nosyko.no> Date: Thu, 23 Mar 2006 16:51:09 +0100 From: =?windows-1252?Q?=C5smund_Kveim_Lie?= User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Content-Type: multipart/mixed; boundary="------------060501040405020800060007" X-SA-Exim-Connect-IP: 192.168.20.6 X-SA-Exim-Mail-From: akl@nosyko.no Subject: Text arrays fails with MaxVarCharSize > 16383 X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100) X-SA-Exim-Scanned: Yes (on db.nosyko.no) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200603/159 X-Sequence-Number: 7445 This is a multi-part message in MIME format. --------------060501040405020800060007 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit 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 --------------060501040405020800060007 Content-Type: text/plain; name="psqlodbc_1752.log" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="psqlodbc_1752.log" 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 connect option (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 connect option (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 --------------060501040405020800060007--