Re: Re: any way for a transaction to "see" inserts done earlier in the transaction?

From: Susan Cassidy <susan(dot)cassidy(at)decisionsciencescorp(dot)com>
To: Robert DiFalco <robert(dot)difalco(at)gmail(dot)com>
Cc: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: any way for a transaction to "see" inserts done earlier in the transaction?
Date: 2014-04-17 14:54:35
Message-ID: CAE3Q8onCTMWKe+Dg_rAvpZK0_JuE+JeXH9PfJ8-tF22CRrGs9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've never had that happen before, and I've used Perl and DBI a lot.

Susan

On Wed, Apr 16, 2014 at 5:34 PM, Robert DiFalco <robert(dot)difalco(at)gmail(dot)com>wrote:

> Two common cases I can think of:
>
> 1. The PERL framework is only caching the insert and does not actually
> perform it until commit is issued.
> 2. You really are not on the same transaction even though it appears you
> are and the transaction isolation is such that you cannot see the insert
> until it is fully committed.
>
>
> On Wed, Apr 16, 2014 at 5:28 PM, David G Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>> One possibility is that the INSERT is going to a different table (having
>> the
>> same name but existing in a different schema) that is visible/default to
>> the
>> function but not outside of it.
>>
>> Or the function on the server is not "current" and thus isn't doing what
>> you
>> think it is.
>>
>>
>> > I do an insert via a function, which returns the new id, then later I
>> try
>> > to SELECT on that id, and it doesn't find it.
>> >
>> > Could it be because the insert is done inside a function?
>>
>> Not by itself; but that factor could be interacting with something else to
>> cause the observed behavior. As noted above functions are able to
>> maintain
>> their own "schema" environment so what is executed in one and outside of
>> one
>> can indeed target different physical objects - which has nothing to do
>> with
>> transaction visibility.
>>
>>
>> Susan Cassidy-3 wrote
>> > It is a fairly large and complex Perl program, so no, not really.
>>
>> Then you need to recreate a functionally similar, but limited, test case
>> that either exhibits the behavior in question or causes you to realize
>> what
>> you are doing in wrong in the "large and complex Perl program".
>>
>> David J.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://postgresql.1045698.n5.nabble.com/any-way-for-a-transaction-to-see-inserts-done-earlier-in-the-transaction-tp5800432p5800459.html
>> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>>
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Spence 2014-04-17 14:56:02 Re: Arduino SQL Connector
Previous Message Adrian Klaver 2014-04-17 14:51:24 Re: Arduino SQL Connector