pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: How to get updated order data
Date: Thu, 7 Apr 2022 16:16:17 +0300
Message-ID: <1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee> (raw)

Hi!

Orders are in table

         create table order (
           dokumnr int primary key,
           packno char(10)
           );
        insert into order dokumnr values (123);

One user sets pack number using

     update order set packno='Pack1' where dokumnr=123

3 seconds later other user retrieves pack number using

     select packno from order where dokumnr=123

However, other user gets null value, not Pack1 as expected. After some 
time later, correct value Pack1 is returned.

How to get updated data from other user immediately?
3 seconds is long time, it is expected that select suld retrieve update 
data.

There are lot of transactions running concurrently. Maybe update command 
is not written to database if second user retrieves it.

How to flush orders table so that current results are returned for 
second user select ?

Using

PostgreSQL 13.2, compiled by Visual C++ build 1914, 64-bit

and psqlODBC driver.

Andrus.

view thread (3+ messages)  latest in thread

Message-ID: <1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee>
Permalink:  ../1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee/
Also on:    postgresql.org/message-id/1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kobruleht2@hot.ee
  Subject: Re: How to get updated order data
  In-Reply-To: <1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee>
  References: <1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox