Text arrays fails with MaxVarCharSize > 16383
am 23.03.2006 16:51:09 von aklThis is a multi-part message in MIME format.
--------------060501040405020800060007
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
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 <=3D 16383 it works and I get =91{=93Hello world=94}=92 ba=
ck, but
setting it to =964 (unlimited length) or > 16383 I get an empty string an=
d
an error in the log.
I=92m using PostgreSQL 8.1.3 and ODBC 08.01.0200.
Best regards,
=C5smund 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
Content-Type: text/plain
Content-Disposition: inline
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
--------------060501040405020800060007--