Re: Unique Constraint with foreign Key

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Unique Constraint with foreign Key
Дата
Msg-id 20040210201521.GA13737@wolff.to
обсуждение исходный текст
Ответ на Unique Constraint with foreign Key  (mohan@physics.gmu.edu)
Ответы Re: Unique Constraint with foreign Key  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-sql
On Tue, Feb 10, 2004 at 12:03:36 -0500, mohan@physics.gmu.edu wrote:
> Hi all i am using postgres and torque
> I have a column x in Table A of type varchar and NOT NULL. I want to
> impose a unique key constraint on that table and column y is the primary
> key.
> I have another Table B with column x. can i make this column x as a
> foreign key on column x in table A.

Yes. The reference will need to specify column x, since the primary key
column (y) will be the default.

> or Can i have varchar types  of size 50 as primary keys in Postgres.

Yes. But unless the 50 character limit comes from a business rule, you
might want to use the type 'text'.


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

Предыдущее
От: mohan@physics.gmu.edu
Дата:
Сообщение: Unique Constraint with foreign Key
Следующее
От: "David B"
Дата:
Сообщение: Elegant way to monitor for changes in a trigger and migrate record to history table