[Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation

From: 毛瑞嘉 <alanmao94(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation
Date: 2019-07-30 21:43:05
Message-ID: CABs5xR7ikrN=V6iF4BsuLrnvvGS+iE4rc+4Dn_bHM+eEgti5ug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I wrote a patch for adding CORRESPONDING/CORRESPONDING BY to set operation.
It is a task in the todo list. This is how the patch works:

I modified transformSetOperationStmt() to get an intersection target list
which is the intersection of the target lists of the left clause and right
clause for a set operation statement (sostmt). The intersection target list
is calculated in transformSetOperationTree() and then I modified the target
lists of the larg and rarg of sostmt to make them equal to the intersection
target list. Also, I also changed the target list in pstate->p_rtable in
order to make it consistent with the intersection target list.

I attached the scratch version of this patch to the email. I am not sure
whether the method used in the patch is acceptable or not, but any
suggestions are appreciated. I will add tests and other related things to
the patch if the method used in this patch is acceptable.

Best,

Ruijia

Attachment Content-Type Size
CORRESPONDING.patch.zip application/zip 5.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-07-30 21:44:49 Re: Patch to document base64 encoding
Previous Message Tomas Vondra 2019-07-30 21:17:59 Re: idea: log_statement_sample_rate - bottom limit for sampling