ERROR: _bt_orderkeys: key(s) for attribute 1 missed

Started by Maurice Gittensalmost 28 years ago1 messages
#1Maurice Gittens
mgittens@gits.nl

Hi,

As part of my 'learning postgresql' project I've been hacking the the
backend
a bit.
Now I get the following error message:

ERROR: _bt_orderkeys: key(s) for attribute 1 missed

from the index_getnext call in the following code:

ScanKeyEntryInitialize(&skey[0], (bits16)0x0,
ObjectTalksContextAttributeNumber,
(RegProcedure)ObjectIdEqualRegProcedure,
ObjectIdGetDatum(ctxo));

namestrcpy(&name, (char*)ctxn);

ScanKeyEntryInitialize(&skey[1], (bits16)0x0,
1,
(RegProcedure)NameEqualRegProcedure,
NameGetDatum(&name));

scandesc = index_beginscan(indexrel,false,2,skey);

if ((indexresult = index_getnext(scandesc,
ForwardScanDirection)))

The code is supposed to search an index created by the following statement:

CREATE UNIQUE INDEX ot_context_idx on ot_context using btree (ctx, name)

Any hints as to where I'm screwing up?:

Thanks for any hints,
with regards from Maurice.