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 1juv81-0001lI-FD for pgsql-general@arkaria.postgresql.org; Mon, 13 Jul 2020 09:52:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juv7U-0003FR-4I for pgsql-general@arkaria.postgresql.org; Mon, 13 Jul 2020 09:51:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juv7T-0003C1-RD for pgsql-general@lists.postgresql.org; Mon, 13 Jul 2020 09:51:31 +0000 Received: from smtp.vivaldi.net ([31.209.137.12]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juv7O-0000Fx-Fb for pgsql-general@lists.postgresql.org; Mon, 13 Jul 2020 09:51:30 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.vivaldi.net (Postfix) with ESMTP id 5A5B8BF739 for ; Mon, 13 Jul 2020 09:51:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net 5A5B8BF739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivaldi.net; s=default; t=1594633884; bh=E4+FW/TXPGAO6a2GdN7rSFZx0qNlenCDibKZL3bTb6o=; h=Subject:To:References:From:Date:In-Reply-To:From; b=EzcyVo8ZMxaXvOo2z5QGVAecZQv31TuVjeJEr5Vp8kK3JrQJp6BwrIY3/Hkr/JzGG KwgM/Dtr3fNVWT52fu+uu8GNZgz9sqOhzgqMxaXKGJVWghzQn/Oe0xxazYcPh4eJYf 5TIGmFgrDO+MUbnzJj6D9yPWFwsdVKpxncS9mvDN+44QXuiSlWILw6v7g1lTzHjcoU bvzEmMFDQzJXPCQVQm/imbVPKx15YCFbIlNFgpn/3UYQMndhN916hvsGB+6zn5VhJh EYLbsbNFFyUjC0F5xA0d7HWrsS1fli7rMLLifvEtmv6cZlpflOO4T+KXiQ4LWoZGNh wLpHJ1TQockGQ== X-Virus-Scanned: Debian amavisd-new at smtp.vivaldi.net Received: from smtp.vivaldi.net ([127.0.0.1]) by localhost (mxo.viv.dc01 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lrqQ7mAzlzaE for ; Mon, 13 Jul 2020 09:51:21 +0000 (UTC) Subject: Re: Doubt in mvcc DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net 52E8ABF73C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivaldi.net; s=default; t=1594633881; bh=E4+FW/TXPGAO6a2GdN7rSFZx0qNlenCDibKZL3bTb6o=; h=Subject:To:References:From:Date:In-Reply-To:From; b=POvLsIDnKIQW6o4XZ6cVkVQZkTN0covRpoJHQceW0YnBlxLz0tqWDZcTIfF75VsM+ GAGUYfMxPN9dblrW7yCQT04VV/rfYx2F4oohklVh5WbIPyQ/rXkx/FEOIboemvYT/l B+rjGt7ltIjE5RCfnBpRyP3k8rxUkbNpK6aIPokSSeDiTc9UBN1+Q7USuxo9VRg8RE kx0B8WvqAhBnb7JVK2C0U13JCVc+N7tKywXt+2gPSlMxN97Dka4dwRT1OUuGKNfLKY pwvDogz/X60nhZYjO7cEZqo64u68Z70DlhvpjK3wEjHULLl0Fb1QFXF4q2Zo5y1MbN bDEE/rauP4ZEA== To: pgsql-general@lists.postgresql.org References: From: Ravi Krishna Message-ID: <81860c68-0d85-facd-01a9-8db1a72f933a@vivaldi.net> Date: Mon, 13 Jul 2020 05:51:19 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/13/2020 4:52 AM, Rama Krishnan wrote: > For example, two transactions are going to increase the amount on the > same account by $100 . The first transaction reads the current value > ($1000) and then the second transaction reads the same value. The first > transaction increases the amount (this gives $1100) and writes this > value. The second transaction acts the same way: it gets the same $1100 > and writes this value. As a result, the customer lost $100. > > > Will u please provide more details > > > Serialize is the solution to this issue. MVCC applies to read and write situation. Readers do not block writers and writers do not block read. The example you mentioned above is writer vs writer and MVCC (both Oracle and PG) is not applicable.