About adding a new filed to a struct in primnodes.h - Mailing list pgsql-hackers

From Andy Fan
Subject About adding a new filed to a struct in primnodes.h
Date
Msg-id CAKU4AWp7zCdGsQ7pR_Eza1wrbb1fwb6X2c7RE6XoNKfg1+_nqg@mail.gmail.com
Whole thread Raw
Responses Re: About adding a new filed to a struct in primnodes.h  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Hi: 

For example, we added a new field in a node  in primnodes.h

struct FuncExpr
{

 +  int newf; 
};

then we modified the copy/read/out functions for this node.  In _readFuncExpr,
we probably add something like 

static FuncExpr
_readFuncExpr(..)
{
..
+ READ_INT_FILED(newf); 
}; 

Then we will get a compatible issue if we create a view with the node in 
the older version and access the view with the new binary.  I think we can
have bypass this issue easily with something like 

READ_INT_FIELD_UNMUST(newf, defaultvalue); 

However I didn't see any code like this in our code base.   does it doesn't 
work or is it something not worth doing? 

--
Best Regards
Andy Fan

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Custom compression methods
Next
From: Amit Kapila
Date:
Subject: Re: Remove cache_plan argument comments to ri_PlanCheck