Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vV21N-00CEUU-2G for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Dec 2025 06:25:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vV21L-00Fs53-2N for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Dec 2025 06:25:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vV21L-00Fs4v-1R for pgsql-bugs@lists.postgresql.org; Mon, 15 Dec 2025 06:25:24 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vV21I-000oOl-0N for pgsql-bugs@lists.postgresql.org; Mon, 15 Dec 2025 06:25:22 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-47a8195e515so24415835e9.0 for ; Sun, 14 Dec 2025 22:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1765779919; x=1766384719; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=fJ7AWs8QoJa986TDgCRPLzETW+RFhtA0eHPvj9osxiQ=; b=Cziv5BDEW0R58ZgKuWL6JHEXD6t6E6lvq4o8sUz+ZBFdPsXGFReyLHa2vB3f2HybhA MopMgH0FyJ85fOteEDlNv1jdP6qoK6y8rkoBor1vvz286JSx4jXz+Coz9tgih86/O6U5 h8BNR+RuIBopBWcLiphnX/neLTiIBkZzSkh9IFdgMYbjC+rFFWSAUcs8r/xKRfK5Cs5i qR3KlXHiPjIkBYrVpWyINyaovP4+oVU5QOANSgKCrIf/69Flxb+DH1krkiVNCK9ZrkEy gocMFPMLERc259ic1BmlmDX0Ia4+pRbZ37YplkqKaXK3B1JJZLiAs2JnKrZ6XriZ07H6 x+Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765779919; x=1766384719; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fJ7AWs8QoJa986TDgCRPLzETW+RFhtA0eHPvj9osxiQ=; b=nblKXSb2xrrz16+lDEysyLa+HKqqw4JRO4sZDvLC/0XCtcp3Jy+BIZ6LLS6Ek0xKfT kC0wRHu8HhgUYjhPdro+F/R4TDP7yvdJwGMvpESYmPCJ0XEtynPH9Kceb5JvnI4ppT3M QeAFlba0vgSeZ22454YC9MafAz2E6/K7Te3pnwz/s8KDq2HqupwjnGcUUuVdwNPkuFZH iQwugA5bSVI2H3L0BsqJvOkETNgGx0iBpH3yEeMkAsTXovimLlGN5wHCqadJrB2chWtS 8zYexciDLSjpHLRt0rGu0aZKpNAn+ClAL7XaMzgKfhdioKysAb0MG0oj69xrMxZDTmN1 xWEA== X-Forwarded-Encrypted: i=1; AJvYcCWD0VN52NQNhit7r2J2CaRZDcVASpYzCCP6cNysdGVNt5ToZjw0K+8fVzWhn1oAqwq1ZLrUL9CAUmbd@lists.postgresql.org X-Gm-Message-State: AOJu0YwB1QfubxsND1J2Wtv2Guh0Em+IWLqsLU/bZFxUp9wW6ZR1OUfn Gtjd0Xa+gM2GXONUdWmkXd+czrS7SNrAjp/1Qe4M2A/g1kOmyQS+TWZNW9sy4ZdvxZw= X-Gm-Gg: AY/fxX5MK7efGunmJReRuO+vwoGF6jFBH9dxjIJtxqRZNP5wwhxk/pimPAafSmin1Vt jR3VoQuz68+YLs0y6FoZP1hPUkuGQIWQirphk6GW6KwdD/BmrrZ5BCnESx5C928YxX404VIB26k 6fWAVVGOv2Q/DuIaagEM3yRVAs2HLBVorrOnpO2+wMgC/p7ZTsW4BgzRC/4tkPbtG9OgpVxMP9E DYW5q3BpwM7luJ9W5bC6Sh0r9e2aQtcFPWGIhVpW07lqGhR+PiS3OOo4GX2eBVMDuw0K90JBNS6 2XmMSBJ+kRYJqu6LXN5MbnuUdaeIKx5S9WOZ1PUHkJZxIUYhjbobYgNhBOQZFNV6XGIC4tA4uax r/HjmpuwbSXXeXXr4KDAAZVei1VgHq4FKCv7/LwO7R/LiQs0I3lyDf5rEaDODg8s4xSwrwtUfnl Fnj3aaA30DekyAqOSwo7bQKxeps9441BPCyHUtKdtAcuk= X-Google-Smtp-Source: AGHT+IFIzI6DxFDNiCKJPoGaEzusTsT+UaSkj3qR/aemJnNjR4q+QSbnZ9y1sneIIdo8R6m2yBsoUg== X-Received: by 2002:a05:600c:6994:b0:46e:1a5e:211 with SMTP id 5b1f17b1804b1-47a8f906511mr85619755e9.21.1765779918972; Sun, 14 Dec 2025 22:25:18 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:270:4cf9:1875:33eb:6694:f468]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-430fc36c83fsm5686231f8f.19.2025.12.14.22.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Dec 2025 22:25:18 -0800 (PST) Message-ID: <868ff2a518820c8864b6d28510294b2457a126af.camel@cybertec.at> Subject: Re: BUG #19355: Attempt to insert data unexpectedly during concurrent update From: Laurenz Albe To: wangbihua.cn@gmail.com, pgsql-bugs@lists.postgresql.org Date: Mon, 15 Dec 2025 07:25:18 +0100 In-Reply-To: <19355-57d7d52ea4980dc6@postgresql.org> References: <19355-57d7d52ea4980dc6@postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-12-15 at 01:40 +0000, PG Bug reporting form wrote: > Start two transaction and update on same tuple, raise concurrent update a= nd > evalplanqual.=C2=A0 It will be found out that the session with evalplanqu= al did > not successfully update the data, but instead attempted to insert a row o= f > data incorrectly. I'd say that is expected. If you need a guarantee that either INSERT or UPDATE succeed, you have to u= se INSERT ... ON CONFLICT ... DO UPDATE Yours, Laurenz Albe