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 1lPDLI-0000rN-Bm for pgsql-docs@arkaria.postgresql.org; Wed, 24 Mar 2021 23:55:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lPDLH-0005yY-6p for pgsql-docs@arkaria.postgresql.org; Wed, 24 Mar 2021 23:55:15 +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 1lPDLH-0005yR-0n for pgsql-docs@lists.postgresql.org; Wed, 24 Mar 2021 23:55:15 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPDLA-0002IZ-EJ for pgsql-docs@lists.postgresql.org; Wed, 24 Mar 2021 23:55:14 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D85375C0186; Wed, 24 Mar 2021 19:55:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 24 Mar 2021 19:55:06 -0400 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:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=QVXy4BHq0mMSsRe6a675O5g0mkpzIL3Iga36Wr8ABvc=; b=GU48x/Or dIqVR+hpAMvtJjD7yOh9OyOsq6jZ1KAdJOM/8RGrfyeQU4+mszJFZGQ/shS5O/Xc QpiMHNvq1DxpDPVBeYikkuLDI2cPB9ZvgtDwWvyTBiuIyJY+0RwGBMoLOiHe4cxP NCYYo9MU3YrQfsFRm9Y+bDOrdOv06eS5hx6fr2geOP6sY7pnqBxYRi582JMDoKn0 2dleteI9kLmrmk/QWJS/iDr6BIspRMWXn4ZPvbRhiiEhZk11cIiDEv6rE1lZa57K p1aGPBA/9t4Kxs24FW1/VoyXl9XmJb4rK+QfmEFBGSnbdEO4X1C9fIYqH1g8xhcH 1HtCImI3tEuxEw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegledgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueffhfejieeuueffgedvudekgeeltdeviedvieeufeei ieevgfetheeufeethedvnecukfhppeduledtrdelhedrudelrdelheenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id C49FD1080064; Wed, 24 Mar 2021 19:55:05 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E7E9C2A0BC0; Wed, 24 Mar 2021 20:55:02 -0300 (-03) Date: Wed, 24 Mar 2021 20:55:02 -0300 From: Alvaro Herrera To: "David G. Johnston" Cc: Peter Eisentraut , max1@inbox.ru, Pg Docs Subject: Re: "there is no way to insert less than one row" Message-ID: <20210324235502.GA19006@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Mar-24, David G. Johnston wrote: > On Wed, Mar 24, 2021 at 1:29 PM Peter Eisentraut < > peter.eisentraut@enterprisedb.com> wrote: > > > On 20.03.21 20:16, PG Doc comments form wrote: > > > So, the last insert command inserted zero rows. What is meant by "there > > is > > > no way to insert less than one row"? > > > > I think the point was that you can't insert partial rows. > > Sure, if you think its related to the following sentence. If you think its > related to the subsequent one it means "cannot insert zero rows". Frankly, > both interpretations are wrong, inserting an explicit column list with > omitted columns populated using defaults is a "partial row API" for > inserting data. Not really -- what you're doing in that case is insert a row that has some null columns. It is still a complete row. I'm with Peter: the idea being conveyed is that in tables, rows are atomic units. > I'm also not fond of the word "conceptually" here - its actually a physical > reality that regardless of how one or more rows are supplied they are > inserted one-at-a-time so far as constraints, discussed in the previous > chapter, are concerned (though some constraints can be deferred). That doesn't seem a very interesting distinction, but I agree that this can be worded differently to convey the idea of rows being the basic units more clearly. Maybe something like this: : When a table is created, it contains no data. The first thing to do : before a database can be of much use is to insert data. Data is : inserted one row at a time. Of course you can also insert : more than one row in a single command, but it is not possible to : insert something that is not a complete row. : Even if you know only some column values, a complete row is created. The next paragraphs explain that omitted columns are defaulted, which IMO flows neatly from here. (I would substitute "Of course you can also" with "It is possible to" ... though that results in repetition of the word "possible" ... hmm.) -- Álvaro Herrera 39°49'30"S 73°17'W