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 1k5ZBf-00068M-UZ for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Aug 2020 18:39:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5ZBe-0003GB-NX for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Aug 2020 18:39:50 +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 1k5ZBd-0003G4-15 for pgsql-bugs@lists.postgresql.org; Tue, 11 Aug 2020 18:39:50 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5ZBY-0000Bz-Ru for pgsql-bugs@lists.postgresql.org; Tue, 11 Aug 2020 18:39:48 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 019295C00C8; Tue, 11 Aug 2020 14:39:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 11 Aug 2020 14:39:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm2; bh=l SxOl3DVr2tHdJfoOT9Bx8N0sNwQqTl3kl3eWHygnO4=; b=VThwpa8r4MCRp5rO7 6BMmp2WauUSN9TMHqYCSUmpX1mBw05swEYahq/KTXkXGZ0aAaa9OWWEJ0qZNU1eL +I7J4BeochgwlrUfXXj04096Tzh5iHSeevf5PNIiYV1PE1xZSBeEB7zDoutKFBS0 UuBCEf3hJ7LzkfecJ94Fh8WNeYtvaj0U/bZy4V+fZj7H+x1dXc3hIbieBTf8Atiu sTeywO5D7Xm0Oyl9563vqCj29cW5oYb3/W09xvc4jz3ei+MDclyVBr318rCH9YlW H916wizh7pl2S52bCWyyMDEbKUFFpAwuYLxX5tqoaCQ+pPIW05J61+SAooMzPlNL Tbc3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=lSxOl3DVr2tHdJfoOT9Bx8N0sNwQqTl3kl3eWHygn O4=; b=jAMJ5yz0hlMcnmlghFoTmJyriP9tId7OK6WaPSvQQmwQcQXLH2TkAfsIH XjDiROG2DdaB1LHsGACfD7qAz815DQ+TU7Ncb/agyzqmAnjv/RT5Uu4AQbKbOm1B /I7ks+R1MVQk+tZ8QMwziEIQz/cvpBkRdRIa5Il0a8qU9hkbOJ+03Ih/sGFDE8OW mkVFZWcWTBVtltIvBmilsGR9VYc+AZ5HCyFH2wAKHrsuPCneNsurXh67haaWFs4X hVF7VOxYM5QoydrsIb4s/RHsCEJobQkkxcYcecD6NdgfXeClEpSJ4wfe0ODlWSxU gM4/v211lrCoZlhwlOgICX20kpX7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrledtgdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjgesthekredttddtudenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnheplefhfeetheejieeigfevieehveevuedtkeekffegueekkedvfeevjeet jeevgeetnecuffhomhgrihhnpehfohhrrdhnvghtpdgrnhgurdhnvghtnecukfhppeeije drudeitddrvddujedrvdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 677003280065; Tue, 11 Aug 2020 14:39:41 -0400 (EDT) Date: Tue, 11 Aug 2020 11:39:40 -0700 From: Andres Freund To: Pavel Biryukov <79166341370@yandex.ru> Cc: Tom Lane , Robert Haas , PostgreSQL mailing lists Subject: Re: posgres 12 bug (partitioned table) Message-ID: <20200811183940.z6hvnu4uptkhugom@alap3.anarazel.de> References: <141051591267657@mail.yandex.ru> <1251598.1591289850@sss.pgh.pa.us> <3398357.1597160032@sss.pgh.pa.us> <1058041597161586@mail.yandex.ru> <20200811172241.izeyvksgevbtvhcd@alap3.anarazel.de> <24981597170121@mail.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <24981597170121@mail.yandex.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-08-11 21:31:52 +0300, Pavel Biryukov wrote: > Entity Framework is an ORM for .Net (and .Net Core). It has different providers > for different databases (NpgSql for Postgres). It uses Optimistic concurrency. > The common use case is to use xmin as "concurrency token". >   > In code we make "var e = new Entity();", "dbContext.Add(e)" and > "dbContext.SaveChanges()" (smth like that), and EF Core constructs sql for us, > classical ORM; >   > When new row is inserted, EF makes an insert with "RETURNING xmin" to keep it > as concurrency token for further updates (update is made like "where id = [id] > AND xmin=[xmin]" to be sure the row hasn't been updated by other clients). That's not really a safe use of xmin, e.g. it could have wrapped around leading you to not notice a concurrent modification. Nor does it properly deal with multiple statements within a transaction. Perhaps those are low enough risk for you, but I don't xmin is a decent building block for this kind of thing. Greetings, Andres Freund