Re: ERROR: UNIQUE constraint ... not found?

Поиск
Список
Период
Сортировка
От Nigel J. Andrews
Тема Re: ERROR: UNIQUE constraint ... not found?
Дата
Msg-id Pine.LNX.4.21.0304022352360.2573-100000@ponder.fairway2k.co.uk
обсуждение исходный текст
Ответ на Re: ERROR: UNIQUE constraint ... not found?  ("Ed L." <pgsql@bluepolka.net>)
Список pgsql-general
On Wed, 2 Apr 2003, Ed L. wrote:

> > psql:test.sql:12: ERROR:  UNIQUE constraint matching given keys for
> > referenced table "person" not found
>
> Ah.  I was wondering why this didn't work anymore when it worked in 7.1.  I
> guess the change in SERIAL semantics where the unique index is no longer
> created is what causes the problem.  If I used PRIMARY KEY or create a
> unique index manually on person.id, it works fine.  It seems odd that one
> cannot have a foreign key to a non-indexed column in another table.
>

Well, I suppose a trigger on insert and update could be used to impose the
unique constraint, which is what the foriegn key needs, but then every check
and use wouldn't have an index it could potentially use for the lookup.


--
Nigel J. Andrews


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: ERROR: UNIQUE constraint ... not found?
Следующее
От: "scott.marlowe"
Дата:
Сообщение: date format