Re: [HACKERS] Adding PRIMARY KEY info

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Adding PRIMARY KEY info
Дата
Msg-id 199809021449.KAA01468@candle.pha.pa.us
обсуждение исходный текст
Ответ на Adding PRIMARY KEY info  (darcy@druid.net (D'Arcy J.M. Cain))
Ответы Re: [HACKERS] Adding PRIMARY KEY info  (darcy@druid.net (D'Arcy J.M. Cain))
Список pgsql-hackers
> I tried adding the PRIMARY KEY info to pg_class but the resulting data
> base system simply dumps core everywhere.  Can someone point me to the
> areas that need to be addressed?  Here's what I did.  I added a field
> called "relprimary" to pg_class in pg_class.h as type Oid then added
> -1 to the pg_class entries in the appropriate place.  I would also like
> to figure out the oid of the keys for each system table if someone can
> point me to those as well.
>
> The next step, of course, is to turn PRIMARY KEY statements into an
> update to the class table to insert the oid of the KEY field.  I looked
> at parser/analyze.c but I think I have to look deeper.  Any help?

My recommendation is to find a seldom-used field in pg_class, like
relchecks, and find all instances of that in the code, and add code for
your new field in all those places.  You need to assign the value in
call cases where you are inserting into pg_class, not just the initdb
stuff.


--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

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

Предыдущее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] Adding PRIMARY KEY info
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Core dump in regression tests.