Re: brain-teaser with CONSTRAINT - any SQL experts?

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: brain-teaser with CONSTRAINT - any SQL experts?
Дата
Msg-id 1128839091.6751.28.camel@linda.lfix.co.uk
обсуждение исходный текст
Ответ на brain-teaser with CONSTRAINT - any SQL experts?  (Miles Keaton <mileskeaton@gmail.com>)
Ответы PostgreSQL missing in SuSE 10?  (Gregory Youngblood <pgcluster@netio.org>)
Список pgsql-general
On Sat, 2005-10-08 at 22:36 -0700, Miles Keaton wrote:
> ... both isbn and name MUST be in the table, and what I'm
> trying to do is put a CONSTRAINT on the table definition to protect
> against user error, by making sure that any entered isbn is only tied
> to one book-name in that table.

Create a separate table with the two columns name and isbn which are
that table's primary key; on the main table, create a foreign key to the
new table.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html


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

Предыдущее
От: "Uwe C. Schroeder"
Дата:
Сообщение: Re: brain-teaser with CONSTRAINT - any SQL experts?
Следующее
От: Gregory Youngblood
Дата:
Сообщение: PostgreSQL missing in SuSE 10?