Thread: orphan large objects created and invalid cast added for gen field

orphan large objects created and invalid cast added for gen field

From
Andrus
Date:

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.