Dear hackers,

 

I’m modifying backend source codes of pgsql. 

 

While inspecting the heap_update function (src/backend/access/heapam.c), 

 

I found that the relkind fields of all RelationData which is handed over to
heap_update are all the same as ‘r’.

 

I want to distinguish normal relation (actual table) from primary index
relation  (primary indexes of some tables).

 

As you know, there are 6 different relkinds (I,r,S,u,t,v,c). 

 

I guess primary index relation’s relkind’d be the same as normal
relation’s (i.e. ‘r’).

 

 

Is there any way I can distinguish normal relation from primary index
relation in the heap_update function?

 

In the following code, I want to make ‘doIcl = false’ for the primary
index relation.

 

Thank you for reading this.

-------------- -------------- -------------- -------------- -------------- -
------------- -------------- -------------- -------------- -------------- --
------------ -------------- -------------- -------------- -------------- ---
----------- 

 

heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,

                                                ItemPointer ctid,
TransactionId *update_xmax,

                                                CommandId cid, Snapshot
crosscheck, bool wait)

{

                HTSU_Result result;

                TransactionId xid = GetCurrentTransactionId();

                Bitmapset  *hot_attrs;

                ItemId                  lp;

                HeapTupleData oldtup;

                HeapTuple heaptup;

                Page page;

                Buffer buffer, newbuf;

                bool need_toast, already_marked;

                Size newtupsize, pagefree;

                bool have_tuple_lock = false;

                bool iscombo;

                bool use_hot_update = false;

                bool all_visible_cleared = false;

                bool all_visible_cleared_new = false;

 

                /* hongs added; variables */

#ifdef USE_ICL

                bool doIcl = false, newDoIcl = false;

                BufferDesc *bufHdr = NULL;

                BufferDesc *newBufHdr = NULL;              //for inserting
icl log of PageSetLSN

                Page newpage; //for inserting icl log of PageSetLSN

                ItemId  newlp;

                if(relation->rd_rel->relkind != 'r') {

                                doIcl = true;

                }

                else

                                doIcl = false;

#endif

 

-------------- -------------- -------------- -------------- -------------- -
------------- -------------- -------------- -------------- -------------- --
------------ -------------- -------------- -------------- -------------- ---
----------- 

 

 

 

- Best Regards
  Hongchan
  ( <mailto:falls...@cs.yonsei.ac.kr> falls...@cs.yonsei.ac.kr, (02)2123-
7757) -

 

 

Reply via email to