Обсуждение: [Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation

Поиск
Список
Период
Сортировка

[Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation

От
毛瑞嘉
Дата:

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

Вложения

Re: [Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation

От
David Fetter
Дата:
On Tue, Jul 30, 2019 at 02:43:05PM -0700, 毛瑞嘉 wrote:
> 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.

Thanks for sending this!

It needs documentation and tests so people can see whether it does
what it's supposed to do.  Would you be so kind as to include those in
the next revision of the patch?  You can just attach the patch(es)
without zipping them.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



Re: [Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation

От
David Fetter
Дата:
On Tue, Jul 30, 2019 at 02:43:05PM -0700, 毛瑞嘉 wrote:
> 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.

I tried adding documentation based on what I could infer about the
behavior of this patch. Is that documentation correct?

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



Re: [Patch] Adding CORRESPONDING/CORRESPONDING BY to set operation

От
David Fetter
Дата:
On Sat, Aug 03, 2019 at 05:56:04PM +0200, David Fetter wrote:
> On Tue, Jul 30, 2019 at 02:43:05PM -0700, 毛瑞嘉 wrote:
> > 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.
> 
> I tried adding documentation based on what I could infer about the
> behavior of this patch. Is that documentation correct?

This time, with the patch attached.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Вложения