This looks good to me, I only have two minor comments: 1. The test should drop main_table1 and some_t1
2. there's a missing word in a comment (do -> to do) + char *trigcomment; /* comment to apply to trigger, or NULL */ + bool transformed; /* true means no need do parse analysis for * + * whenClause */
