Re: How to make a OpExpr check compatible among different versions

2020-01-13 Thread Andy Fan
On Mon, Jan 13, 2020 at 4:09 PM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2020-01-13 08:29, Andy Fan wrote: > > During one of my works for logical rewrite, I want to check if the expr > > is a given Expr. > > > > so the simplest way is: > > if (expr->opno == 418 && nodeTag(

Re: How to make a OpExpr check compatible among different versions

2020-01-13 Thread Peter Eisentraut
On 2020-01-13 08:29, Andy Fan wrote: During one of my works for logical rewrite,  I want to check if the expr is a given Expr. so the simplest way is: if (expr->opno == 418 && nodeTag(linitial(expr->args)) == T_xxx  && nodeTag(lsecond(expr->args)) == T_ ) {  .. } if we write code like a

How to make a OpExpr check compatible among different versions

2020-01-12 Thread Andy Fan
During one of my works for logical rewrite, I want to check if the expr is a given Expr. so the simplest way is: if (expr->opno == 418 && nodeTag(linitial(expr->args)) == T_xxx && nodeTag(lsecond(expr->args)) == T_ ) { .. } if we write code like above, we may have issues if the oid change