Re: foreign keys constraints, depending on each other

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: foreign keys constraints, depending on each other
Дата
Msg-id Pine.BSF.4.21.0106101348450.44246-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на foreign keys constraints, depending on each other  (zilch@home.se)
Ответы Re: foreign keys constraints, depending on each other  (zilch@home.se)
Список pgsql-general
On Sun, 10 Jun 2001 zilch@home.se wrote:

>
> I was just creating this little database for demonstrating the use of
> foreign keys constraints.
>
> I was about the create 3 tables, namely mother, father and child. Mother has
> a foreign key pointing at father ( id ), and father has a foreign key
> pointing at mother ( id ). Child has one pointer to mother ( id ) and one
> pointer to father ( id ). How can I prevent the error message from occurring?

You don't put the constraint at table creation time.  The table referenced
by the references has to exist.  Use ALTER TABLE to add the constraint
after creating table father.


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

Предыдущее
От: zilch@home.se
Дата:
Сообщение: Re: inserting, index and no index - speed
Следующее
От: zilch@home.se
Дата:
Сообщение: Re: foreign keys constraints, depending on each other