Re: [Beginner Question]What's the use of ResTarget?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Wen Yi <wen-yi(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: [Beginner Question]What's the use of ResTarget?
Date: 2023-07-09 10:59:31
Message-ID: 20230709105931.433b65q2r5debqfh@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2023-Jul-02, Wen Yi wrote:

> Hi community
> When I read the Internals document (41.1. The Query Tree),
> the introduction of&nbsp; 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2023-07-09 11:01:49 Re: How to add function schema in search_path in option definitio
Previous Message Adrian Klaver 2023-07-08 21:10:18 Re: How to add function schema in search_path in option definitio