Re: When is newly inserted data visible to another connection?

From: Yeb Havinga <yebhavinga(at)gmail(dot)com>
To: "fkater(at)googlemail(dot)com" <fkater(at)googlemail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: When is newly inserted data visible to another connection?
Date: 2010-08-18 11:29:44
Message-ID: 4C6BC428.4000409@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

fkater(at)googlemail(dot)com wrote:
> Hi all,
>
> If there is nothing else wrong in our test case we noticed
> the following:
>
> We have done a test with two connections to the database on
> different computers. After the first client (writer) had
> inserted new data into a quite simple table, it told another
> client (by TCP communication) to be ready, however, this
> second client (reader) did not see the data then immediately
> in the database. So we delayed the reading client from 2 to
> 5s to have it see all data in the table.
>
Essential information is missing. Did the first client COMMIT before
toggling client 2? Also you might find the information from
http://developer.postgresql.org/pgdocs/postgres/transaction-iso.html
interesting, since that specifies how to control behaviour of concurrent
transactions looking at each others data.
> Secondly: If yes, is there a way to determine when newly
> inserted data is visible to other clients?
>
Not before it is committed. To which clients the just committed data is
visible depends on the transaction isolation level (see link above).

regards,
Yeb Havinga

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeremy Palmer 2010-08-18 11:35:07 Re: Win32 Backend Cash - pre-existing shared memory block is still in use
Previous Message Arturo Pérez 2010-08-18 11:20:21 nntp not working