Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: >> I'd suggest issuing the NOTICE inside the loop, actually, >> and not breaking at all. (See also #4)
> I don't quite understand what you mean here? Just do elog(NOTICE) inside the loop over indexes, rather than setting a flag to do it later. For that matter, I see no reason not to raise the elog(ERROR) condition inside the loop, rather than setting a flag to do it later. > I admit I was confused as to why it's keyno - 1?? To make a zero-based C array index from the one-based attribute number. But the problem with this code is it doesn't handle indexes on system attributes such as OID, which have negative attribute numbers and are not shown in rel->rd_att->attrs. I'd be inclined to use get_attname, and not bother with looking into the relcache rd_att structure at all. > I was going to do this, but then realised all I had access to in the > indexStruct was the oid of the index relation? What's the easiest way of > retrieving the name of an index given it's oid, or the oid of it's > relation? get_rel_name regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]