Tables Referencing themselves As Foreign Keys

Поиск
Список
Период
Сортировка
От Tony (Unihost)
Тема Tables Referencing themselves As Foreign Keys
Дата
Msg-id 3FE6CE27.5080102@unihost.net
обсуждение исходный текст
Ответы Re: Tables Referencing themselves As Foreign Keys
Re: Tables Referencing themselves As Foreign Keys
Список pgsql-general
Hi,

I'm still new to this so if I'm sounding dumb or my premise is flawed
please forgive me.  I have a DB design which contains a table which has
categories, each category has a parent category, and is recursed until
the top category is reached, in order to create breadcrumbs.  Is there
any problem with using foreign keys to reference the same table?  So a
when category is added the CatParent MUST be present as a CatID

CatID - Serial
CatParent - int4 - References CatID
CatName - Text

Am I likeley to come unstuck with this?

Cheers

T.







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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Groff and Weinberg SQL Complete Reference - Sample database?
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: questions about tsearch2 (for czech language)