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 1ncnhR-0005zX-J6 for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 12:26:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncnhQ-0001CT-4D for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 12:26:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncnhP-0001CK-M7 for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 12:26:47 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ncnhM-0006OO-N7 for pgsql-general@postgresql.org; Fri, 08 Apr 2022 12:26:47 +0000 Received: by mail-ej1-x633.google.com with SMTP id n6so16919080ejc.13 for ; Fri, 08 Apr 2022 05:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=YTZwtglYMu8KKwM3Yubzz9KcBAK+WL4Rmcdyn1BMsmM=; b=DEXpVKdchkN1y9ZuzWqWoqttWffU9WF7MlgyWmvMUDIb1qz/Mn+ZVF7hzQexLJFL22 jR/CB1Ii4XR1KloqIQWA6dnyi0cBNwygZJ3PYchUEUFzZNdXmF+5o2yi5I+/eq54rpbw w5zuEnfz4IDFlw4gXtXkh52dIzSUh0tmndfV0IpWARvRwVhS+7jguZG/JMbLxQggp9yM HOQPEOahPzu5Uy5925/PY1Xf/++GZVkkV8hiQUp0vr5a5ZhuefZ3MqrdivpZNXgnFJ/p F+NP93q+iIzkIdzLPLci6EfX2yzaCA6+q4bIvN5JLpghrdJ2xs8ou9K2SlOvoE5MtSqY BsWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=YTZwtglYMu8KKwM3Yubzz9KcBAK+WL4Rmcdyn1BMsmM=; b=X8Ps2LbroYp8DWkVut9lBkRJ1vMCfhOpD4S3APkvHXM9EiWsNHRAlQ9nu5FI3i7kjs su+uKkHRk1aT6/n1DMdOn4lAqWiXXU8oDgQAqYBGgzuj9iQgJMCbX3RpQQHDru/ha5uE GTs3N83pnT1fNzOHhOuNYJoiirlrNwRcnAI+AHCNXz1hFoFvj5dY2pIZiclIv4EnrUGp zhXaJ9BZyDLNfo+6cpPWP+C2Ax6bFgckqKwqwF+3lGFsYoAZWNTrCg/LP0Iabx0Q0xzJ NEgg2auHSDCtILal3GWkmvkIxPe9Eagn+fv0FWkZDqmVysagHeBY9TewxzjG/wry9t34 nPvA== X-Gm-Message-State: AOAM530cZDs5P/VdjZ0FeR//mqU1nt2SCVZ2pPgmKpUb15DYFlRA6LK4 JU4NlPQt0TKdyh3ojZyiOKI3zw== X-Google-Smtp-Source: ABdhPJzTuEd3AEuu55GLt75/1PB0qqsqXpH5b/EgrJEZREnGKq8TJyXnAWtz6puGMpLCwGjGyZsyTw== X-Received: by 2002:a17:907:d23:b0:6db:6c6:8558 with SMTP id gn35-20020a1709070d2300b006db06c68558mr17746001ejc.141.1649420803605; Fri, 08 Apr 2022 05:26:43 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:598:857b:a04f:3078:93e0]) by smtp.gmail.com with ESMTPSA id a22-20020a50ff16000000b00410d029ea5csm10267203edu.96.2022.04.08.05.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 05:26:43 -0700 (PDT) Message-ID: <54be8b47fad3440b377ae2e53d02b5ca60a6c2a7.camel@cybertec.at> Subject: Re: How to get updated order data From: Laurenz Albe To: Andrus , pgsql-general Date: Fri, 08 Apr 2022 14:26:42 +0200 In-Reply-To: <1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee> References: <1a7a890c-3a74-e9ad-70b0-78f817a082bb@hot.ee> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-3.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2022-04-07 at 16:16 +0300, Andrus wrote: > 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. That cannot happen, unless a) the UPDATE runs in a transaction that hasn't been committed b) the SELECT is running on a standby server, and there is replication lag Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com