Thread: Postgesql ODBC driver and large objects

Postgesql ODBC driver and large objects

From
"Robert Ewald"
Date:
Hi,

I have following problem with the ODBC driver or is it the server? I have an
MS Access Database which I want to put into a postgres database to have MS
Access to be only the frontend. That worked fine until I came across an OLE
field.
So I created an lo type in my postgres database as it is described in the
postodbc faq.
Now, when I want to access the lo type field in my postgres database from ms
access then I get an error:

"Socket has been closed"

the postmaster log returns something like this:

indExec: found "/usr/lib/pgsql/bin/postgres" using argv[0]
/usr/lib/pgsql/bin/postmaster: BackendStartup: pid 16319 user postgres db
test socket 5
FindExec: found "/usr/lib/pgsql/bin/postgres" using argv[0]
started: host=192.168.1.2 user=postgres database=test
InitPostgres
StartTransactionCommand
ProcessUtility
CommitTransactionCommand
.
.
.
StartTransactionCommand
CommitTransactionCommand
TRAP: Bad Argument to Function call("!(AllocSetContains(set,pointer)):",
File: "aset.c", Line: 214)
!(AllocSetContains(set, pointer)) (0)
/usr/lib/pgsql/bin/postmaster: reaping dead processes...
/usr/lib/pgsql/bin/postmaster: CleanupProc: pid 16319 exited with status 6
/usr/lib/pgsql/bin/postmaster: CleanupProc: reinitializing shared memory and
semaphores
shmem_exit(0) [#0]
pmdie 15
proc_exit(0) [#0]
shmem_exit(0) [#0]
exit(0)

and the odbc driver log returns this:

conn=79233144,
QLDriverConnect( in)='DSN=PostgreSQL;UID=postgres;PWD=p;DATABASE=test;SERVER
=artus;PORT=5432;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWV
ERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS=;', fDriverCompletion=0
DSN info:
DSN='PostgreSQL',server='artus',port='5432',dbase='test',user='postgres',pas
swd='p'

readonly='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'         conn_settings=''
translation_dll='',translation_option=''
Global Options: Version='06.40.0006', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=4094               disable_optimizer=0, ksqo=1,
unique_index=1,
use_declarefetch=0               text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=0               extra_systable_prefixes='dd_;', conn_settings=''
conn=79233144, query=' '
conn=79233144, query='set DateStyle to 'ISO''
conn=79233144, query='set ksqo to 'ON''
conn=79233144, query='select oid from pg_type where typname='lo''   [ fetched 1 rows ]   [ Large Object oid = 18464 ]
conn=79233144,
SQLDriverConnect(out)='DSN=PostgreSQL;DATABASE=test;SERVER=artus;PORT=5432;U
ID=postgres;PWD=p;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROW
VERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS='
conn=79233144, query='SELECT "ole"."id" FROM "ole" '   [ fetched 1 rows ]
conn=79233144, query='SELECT "id","name",'#S_C_H#'  FROM "ole"  WHERE "id" =
1 OR "id" = 1 OR "id" = 1 OR "id" = 1 OR "id" = 1 OR "id" = 1 OR "id" = 1 OR
"id" = 1 OR "id" = 1 OR "id" = 1'   [ fetched 1 rows ]
conn=79233144, query='SELECT "object"  FROM "ole"  WHERE "id" = 1'   [ fetched 1 rows ]
conn=79233144, query='SELECT "object"  FROM "ole"  WHERE "id" = 1'
STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while
executing the query'                -----------------------------------------------------------
-                hdbc=79233144, stmt=79314784, result=0                manual_result=0, prepare=1, internal=0
    bindings=79313916, bindings_allocated=1                parameters=79313632, parameters_allocated=1
statement_type=0,statement='SELECT "object"  FROM "ole"
 
WHERE "id" = ?'                stmt_with_params='SELECT "object"  FROM "ole"  WHERE "id" =
1'                data_at_exec=-1, current_exec_param=-1, put_data=0                currTuple=-1, current_col=-1,
lobj_fd=-1               maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0,
 
scroll_concurrency=1                cursor_name='SQL_CUR04BA3F60'                ----------------QResult
Info -------------------------------
CONN ERROR: func=SC_execute, desc='', errnum=104, errmsg='Could not send
Query to backend'           ------------------------------------------------------------           henv=80285584,
conn=79233144,status=1, num_stmts=16           sock=80285600, stmts=80281732, lobj_type=18464
----------------Socket Info -------------------------------           socket=57, reverse=0, errornumber=10,
errormsg='Sockethas been
 
closed.'           buffer_in=79239472, buffer_out=79243572           buffer_filled_in=0, buffer_filled_out=0,
buffer_read_in=1


I am able to put one object into this field, but i cannot retrieve it. I
have to close ms access and to restart the postmaster then I can read this
object and the everything is down again.

how can i fix this?

thanks for your help

Robert