Re: Beta time

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Beta time
Дата
Msg-id 14357.1001173561@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Beta time  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: patch for contrib/intarray (CVS)
Следующее
От: Matti.Lehtonen@stonesoft.com
Дата:
Сообщение: DROP TABLE and DROP INDEX hangs up in version 7.1.3, when...