Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l72Ah-0002bk-TL for pgsql-odbc@arkaria.postgresql.org; Tue, 02 Feb 2021 20:21:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l72AA-0006ZM-GR for pgsql-odbc@arkaria.postgresql.org; Tue, 02 Feb 2021 20:20:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6zIC-0007J1-2e for pgsql-odbc@lists.postgresql.org; Tue, 02 Feb 2021 17:16:44 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6zI8-00013M-5d for pgsql-odbc@lists.postgresql.org; Tue, 02 Feb 2021 17:16:43 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 814B11D61 for ; Tue, 2 Feb 2021 19:16:38 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gjg4dqwa2ZFy for ; Tue, 2 Feb 2021 19:16:35 +0200 (EET) Received: from mail.hot.ee (hot-relayhost1.estpak.ee [213.180.2.79]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 70E7A1D4C for ; Tue, 2 Feb 2021 19:16:35 +0200 (EET) From: Andrus To: pgsql-odbc@lists.postgresql.org Subject: orphan large objects created and invalid cast added for gen field Message-ID: <9ade4722-3082-96d0-6bfa-0e486e5b3280@hot.ee> Date: Tue, 2 Feb 2021 19:16:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------4E8BC7DD726DA9CC0EE66CA8" Content-Language: et List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------4E8BC7DD726DA9CC0EE66CA8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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. --------------4E8BC7DD726DA9CC0EE66CA8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

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.



--------------4E8BC7DD726DA9CC0EE66CA8--