ERROR: _bt_orderkeys: key(s) for attribute 1 missed - Mailing list pgsql-hackers

From Maurice Gittens
Subject ERROR: _bt_orderkeys: key(s) for attribute 1 missed
Date
Msg-id 002d01bd46f0$ea0f2b80$a8fb4fc1@caleb..gits.nl
Whole thread Raw
List pgsql-hackers
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.


pgsql-hackers by date:

Previous
From: Brett McCormick
Date:
Subject: no operator '=' for types char16 and text
Next
From: teunis
Date:
Subject: Re: [HACKERS] PostgreSQL - the Linux of Databases...