How to make a OpExpr check compatible among different versions - Mailing list pgsql-hackers

From Andy Fan
Subject How to make a OpExpr check compatible among different versions
Date
Msg-id CAKU4AWqrv8AZQFi7x2O2cME2ifDw18ZDRzuQnMgWwiXyJo_RfQ@mail.gmail.com
Whole thread Raw
Responses Re: How to make a OpExpr check compatible among different versions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
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_yyyy )   
{
 .. 
}

if we write code like above,  we may have issues if the oid changed in the future version. 
so what would be your suggestion? 

Thanks

pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Comment fix in session.h
Next
From: Konstantin Knizhnik
Date:
Subject: Re: [Proposal] Global temporary tables