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 1qIS8m-0000NG-7X for pgsql-general@arkaria.postgresql.org; Sun, 09 Jul 2023 10:59:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qIS8k-0000rU-W3 for pgsql-general@arkaria.postgresql.org; Sun, 09 Jul 2023 10:59:42 +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 1qIS8j-0000rD-UV for pgsql-general@lists.postgresql.org; Sun, 09 Jul 2023 10:59:42 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qIS8g-002rwl-TI for pgsql-general@lists.postgresql.org; Sun, 09 Jul 2023 10:59:40 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 5BA7C32009C6; Sun, 9 Jul 2023 06:59:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 09 Jul 2023 06:59:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1688900373; x= 1688986773; bh=UPVZwXgECPtIEqCuNYzHQsGsQBki167SkzeYePH7ehQ=; b=d Nc32RblgLcnbL3SClbL+U4vGXe5BM1yl2BiIptCuYhqoLDX0iD1K6U3b565P7yl7 987qkYzZdyN7CEJQHskcOjW+DvOWtoWM4hnUZuprwA28ShNwOd2Pjin6sMwKllEK ok0BTaO8Pt3vrTWIfrJC0eV1hpeidcrfubIr9lV20LSwXBCxjGd8rUcqznAShfIC qeIguQl6YHV/Y59mlegIOezbL8nYWuaw53JEgyXnp4BURyyCqaDxbzAO3ue7COk4 KOm1k9UlEU469n7SHpaiVQMIVh5PG+dZb9+GXVD6fJqtqB9latklgK+ctSugR1BT jp4c9TDj7qHvwDPEIPb9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrvdehgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpefgtdegleeggffftdeiuddufffhveekgfdufeethefgtefh kedvgeejlefhteehvdenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmpd hpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Jul 2023 06:59:33 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 4C6729D; Sun, 9 Jul 2023 12:59:31 +0200 (CEST) Date: Sun, 9 Jul 2023 12:59:31 +0200 From: Alvaro Herrera To: Wen Yi Cc: pgsql-general Subject: Re: [Beginner Question]What's the use of ResTarget? Message-ID: <20230709105931.433b65q2r5debqfh@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Jul-02, Wen Yi wrote: > Hi community > When I read the Internals document (41.1. The Query Tree), > the introduction of  the 'the result relation' confuse me. There are "result relations" in commands that modify a relation, such as insert or update. The result relation is where the new tuples are inserted, or where the modified tuples are. > in my original understand, I guess the use of ResTarget is to store > the columns of the result, like: > > SELECT row_1, row_2 FROM table; Yeah. Those aren't necessarily in the result relation, because (as the doc says) a SELECT does not even *have* a result relation. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Once again, thank you and all of the developers for your hard work on PostgreSQL. This is by far the most pleasant management experience of any database I've worked on." (Dan Harris) http://archives.postgresql.org/pgsql-performance/2006-04/msg00247.php