orphan large objects created and invalid cast added for gen field

From: Andrus <kobruleht2(at)hot(dot)ee>
To: pgsql-odbc(at)lists(dot)postgresql(dot)org
Subject: orphan large objects created and invalid cast added for gen field
Date: 2021-02-02 17:16:30
Message-ID: 9ade4722-3082-96d0-6bfa-0e486e5b3280@hot.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi!

Tried latest 13.00.0000 32 bit driver with Visual FoxPro.

1. Created gen type column in client side:

create cursor t ( t gen  )

2. Used psqlodbc to insert this data:

create temp table test ( test bytea ) on commit drop;
insert into test values ( ?t.t );

This code throws exception

type "lo" does not exist

but each call adds new large object (new row to pg_largeobject_metadata
table).

Odbc driver generates strange code:

insert into test values ( '202564337'::lo  );

where 202564337 increases on each call and also creates large object.

This large object remains even if transaction is rolled back due to
unexisting lo type.

C7=0  (bytea as logvarbinary is false) is used in connection string.

Questions:

1. Why odbc driver creates and does not remove large object  if
transaction is rolled bact ?

2.  Why it adds cast to lo type which does not exist ?

It looks like cast is added in line

https://github.com/hlinnaka/psqlodbc/blob/master/convert.c#L4564

Andrus.

Browse pgsql-odbc by date

  From Date Subject
Next Message Rohan Malik 2021-02-04 13:18:20 Error ODBC driver Wrds
Previous Message walid zohair 2021-01-29 17:58:58 Fwd: Raise Notice MS access not working