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 1nNx55-0008Gc-BG for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Feb 2022 13:25:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNx53-00006g-76 for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Feb 2022 13:25:49 +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 1nNx52-00006T-SL for pgsql-hackers@lists.postgresql.org; Sat, 26 Feb 2022 13:25:48 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nNx4w-0007ax-7t for pgsql-hackers@postgresql.org; Sat, 26 Feb 2022 13:25:48 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id d26so8421246vsh.0 for ; Sat, 26 Feb 2022 05:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4LMmLpE+kwvLy1NQyRKPrJq0QiEgwJfY1oqbt6aklPk=; b=PksyTgTnGbb//TKE/8aphawNsQZcA5PJUZaNzOG3YPkuAz/h63PA9S7HGNNo+MDtHt yD4GKyJHajwHqf89FE5uj7gZRUh+v5EJri8vIq3U3hAVAdV6bFMvgCWK8XHNEqRn6GVP spqHXJ62tvtkgrdyoDJ5NmtoEZLI4EUnDrZN5vEy9QvovpKBz+eJNrO9wvU53L+jC4Rh LsV/RocLH16BQsB2apMb9SkxbiodZa4dp9ZmWB33KItoVV/FIsx06KUJ+IHocgT3OoWU gNfZtt7+3iCvoks8KbaOkrAHs9R8A2Me8LCTIwwA3VdMa30oPcAIOog/DijXM+jp7VjG VySQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4LMmLpE+kwvLy1NQyRKPrJq0QiEgwJfY1oqbt6aklPk=; b=uBh7a2zEWWRrYB7NJKn7N5hD5W4HfaXfaFzFUIOji1wINWZuTGeiE4ta8zYhpcjy2i jN7fPhZGi9qZDohDJ8pXcthVwQG/L7ZJVTop43YIxnMSnMpLI65rXGAQ010ni6CagW38 Cu43XCJFPMHH1j+aU4Sm98TDQMGx2uw8r3syJalx0DoJePxYiks7vC81fafmx9FEjoHy wiH2bLdsXFnVctkmXbIIXheqvz+HzbG0dtx9kDmFS07/3rkngxmunylzrJ6VHQZMFQOW z6lpPBET50Lfy8ONgTKi8Zp2ZLcOPoF9jX5Dl5mvtgFdquhoZ1fUXDAKzDozgrc8bWrO 9P4g== X-Gm-Message-State: AOAM531RGf5+2lGApDJRaV2itemZDLZUHjrThhlr8uXx3yk0cdRnX0Ki 5pudt+dkz+qvEVVPwR6aJutmb+kGcM3d2gBcmEk= X-Google-Smtp-Source: ABdhPJwW0d+PtBhNMk6WrV28X0Qco0HM62PZ3N9KVqvlxKIfmaOArz2lFaPnCovGPo5SICtcGEqQfJphMVRhwDgSxtk= X-Received: by 2002:a05:6102:e47:b0:31b:fa92:75c5 with SMTP id p7-20020a0561020e4700b0031bfa9275c5mr5647908vst.35.1645881938818; Sat, 26 Feb 2022 05:25:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Sat, 26 Feb 2022 06:25:22 -0700 Message-ID: Subject: Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause To: Shay Rojansky Cc: Pg Hackers Content-Type: multipart/alternative; boundary="0000000000004e3a2705d8ebc00f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004e3a2705d8ebc00f Content-Type: text/plain; charset="UTF-8" On Sat, Feb 26, 2022 at 5:42 AM Shay Rojansky wrote: > FWIW I've received feedback from a SQL Server engineer that one definitely > should *not* depend on such ordering there, and that future optimizations > (e.g. parallel insertion of many rows) could result in row ordering which > differs from the lexical ordering of the VALUES clause. > > That seems very reasonable; if the situation is similar on PostgreSQL, > then I'd suggest making that very clear in the INSERT[2] and UPDATE[3] docs. > There is clearly no mention of such a guarantee in our documentation. David J. --0000000000004e3a2705d8ebc00f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Feb 26, 2022 at 5:42 AM Shay Rojansky <roji@roji.org> wrote:
=
FWIW I've received feedback from a SQL Server eng= ineer that one definitely should *not* depend on such ordering there, and t= hat future optimizations (e.g. parallel insertion of many rows) could resul= t in row ordering which differs from the lexical ordering of the VALUES cla= use.
=C2=A0
That seems very reasonable; if = the situation is similar on PostgreSQL, then I'd suggest making that ve= ry clear in the INSERT[2] and UPDATE[3] docs.
=
There is clearly no mention of such a guarantee in our do= cumentation.

David J.

--0000000000004e3a2705d8ebc00f--