Re: Composite types for composite primary/foreign keys?

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Composite types for composite primary/foreign keys?
Дата
Msg-id E84A9C32-3E84-4AF0-9E7C-390FB6627566@seespotcode.net
обсуждение исходный текст
Ответ на Composite types for composite primary/foreign keys?  (Wolfgang Keller <wolfgang.keller.privat@gmx.de>)
Ответы Re: Composite types for composite primary/foreign keys?
Список pgsql-general
On Nov 16, 2007, at 4:07 , Wolfgang Keller wrote:

> But I am pathetically lazy >;->, so I ld like to save keystrokes
> and thus I had the (maybe pathetic)idea to use composite types for
> the composite primary (and foreign) keys. No luck again, it seems
> to me, as according to the documentation: "since no constraints are
> associated with a composite type, the constraints shown in the
> table definition do not apply to values of the composite type
> outside the table".

Note: "do not apply to values of the composite type outside of the
table". Both primary keys and foreign keys are defined within tables,
so AIUI this statement does not preclude you from using composite
types as primary and foreign keys.

> I'm sorry, but I'm apparently too dump to actually figure out
> myself whether this means that I can use a single composite type
> column as a primary / foreign key or whether not...?

What have you actually tried? You can learn a lot by a few minutes of
exploration at a psql prompt.

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: "and then" / "or else"
Следующее
От: Christian Schröder
Дата:
Сообщение: Re: "and then" / "or else"