Re: Adding CORRESPONDING to Set Operations
Kerem Kat <keremkat@gmail.com>
From: Kerem Kat <keremkat@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Date: 2011-10-16T23:46:20Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Create a separate grantable privilege for TRUNCATE, rather than having it be
- a0b76dc662ef 8.4.0 cited
Attachments
- corresponding_clause.patch (text/x-patch) patch
CORRESPONDING clause take 2 After realizing that modifying prepunion.c to include a custom subquery is not easy(incomprehensible to me) as it sounds and turning into a hassle after making several uninformed changes, I decided to go with modifying analyze.c. The incomprehensible part is constructing a custom subquery as a SubqueryScan. Anyway I managed to implement the clause as a Subquery in analyze.c. In the method transformSetOperationTree, if the node is a setoperation and contains a corresponding clause, i.e. CORRESPONDING, or CORRESPONDING BY(columns...), we determine the common column names. Column ordering in select statements are not important to the CORRESPONDING. With the common column names in hand, we create a RangeSubselect node accordingly and replace the original statement op->larg with the new RangeSubselect. RangeSubselect in turn has the original op->larg as a from clause. We do the same to op->rarg too. There were no changes done in prepunion.c There are documentation changes and one regression test in the patch. Best Regards, Kerem KAT