X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 73FF7D1E622 for ; Thu, 29 Apr 2004 20:17:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 29640-03 for ; Thu, 29 Apr 2004 20:17:35 -0300 (ADT) Received: from smtp.covadmail.net (mx07.covadmail.net [63.65.120.67]) by svr1.postgresql.org (Postfix) with SMTP id DE0C1D1E2BE for ; Thu, 29 Apr 2004 20:17:31 -0300 (ADT) Received: (covad.net 2201 invoked from network); 29 Apr 2004 23:17:29 -0000 Received: from unknown (HELO covad.net) (rncombs@68.165.46.209) by sun-qmail02 with SMTP; 29 Apr 2004 23:17:29 -0000 Message-ID: <40918D03.7010908@covad.net> Date: Thu, 29 Apr 2004 18:17:23 -0500 From: Richard Combs User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: Transaction oddities? References: <002901c42e2f$c0c93950$5164a8c0@it01> In-Reply-To: <002901c42e2f$c0c93950$5164a8c0@it01> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/127 X-Sequence-Number: 4022 The problem is with the autocommit off and the transaction isolation level you have set. You should not be able to read your changes until after you commit them with this scenario. If you want to do "dirty reads" you need to use read uncommitted. See the following for more information. http://www.postgresql.org/docs/7.4/interactive/transaction-iso.html Ethan Rowe wrote: >Hi. Relative newbie here. > >I'm using the Perl DBI:ODBC (ActiveState Perl 5.8.0) to work with my >psqlodbc DSN (on Windows 2000 SP 4). This generally works fine. >However, I'm having some weird behavior that I haven't seen before and >can't easily test in an alternate configuration. > >My script reads information from a Paradox table, formats it, and pushes >it into PostgreSQL tables. > >I have AutoCommit turned off. My script performs a variety of UPDATE >and INSERT statements within the same transaction. Then, once finished >altering data, it uses a verification routine to compare the results of >the operations (by SELECTing from PostgreSQL) to the source data. > >All of my UPDATE and INSERT statements go through fine. However, when >my verify routine tries to SELECT the data they added/changed, it can't >see it. What makes this weird is if I change the order of events so the >verification of a particular record occurs IMMEDIATELY after the INSERT, >the SELECT does see the new data. Ordinarily, the verification occurs >only at the end. > >And of course, the transaction isn't committed or rolled back until >after the verification step. > >Maybe this has nothing to do with psqlodbc, but I can't tell. I've >tried using SET TRANSACTION ISOLATION LEVEL READ COMMITTED to no avail >(but that's the default anyway, isn't it?) > >Any ideas or mockery or whatever would be greatly appreciated. Thanks. > >Ethan Rowe >Information Systems Administrator >National Braille Press >Boston, MA >617-266-6160 ext. 35 >erowe@nbp.org > > > >---------------------------(end of broadcast)--------------------------- >TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > > > >