Re: [HACKERS] Regarding B-Tree Lookup

2017-05-23 Thread Mahi Gurram
Thank you all for your responses to help me out. The below code worked for me... pasting it here (May be helpful for someone) Relation heap; > ItemPointer ht_ctid; > heap = heap_open(50620, AccessShareLock); /* 50620 - Table/Relation Oid - > Hardcoded for better understanding */ ScanKeyInit(,

Re: [HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Tom Lane
Michael Paquier writes: > On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram wrote: >> Please suggest me the easiest way to lookup into PK's B-Tree index for >> getting TIDs. > Why don't you just use SPI within your extension? No need to copy the > logic

Re: [HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Craig Ringer
On 2 May 2017 7:34 pm, "Michael Paquier" wrote: On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram wrote: > I'm building some custom extension on top of postgres 9.6.1. As part of > that, I would like to read Heap Tuple directly from my extension using >

Re: [HACKERS] Regarding B-Tree Lookup

2017-05-02 Thread Michael Paquier
On Tue, May 2, 2017 at 6:12 PM, Mahi Gurram wrote: > I'm building some custom extension on top of postgres 9.6.1. As part of > that, I would like to read Heap Tuple directly from my extension using > Primary Key. > > By default, postgres table index(B-Tree) its