Re: Question: unique on multiple columns

Поиск
Список
Период
Сортировка
От roverr
Тема Re: Question: unique on multiple columns
Дата
Msg-id 1044456475.13526.28.camel@junkyard
обсуждение исходный текст
Ответ на Re: Question: unique on multiple columns  (will trillich <will@serensoft.com>)
Ответы Re: Question: unique on multiple columns  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
On Wed, 2003-02-05 at 09:09, will trillich wrote:
> On Wed, Feb 05, 2003 at 06:46:35AM -0500, roverr wrote:
<snip>
> > I have a table as follows:
> > col 1: id, type serial, primary key
> > col 2: host_id, type integer, foreign key to hosts table
> > col 3: data_time, type timestamp
> > col 4 - 9 data that is unique to col 2 and 3
> >

<snip>
>
> you can
>
>     create table something (
>         a int4,
>         b varchar(20),
>         c timestamp
>     );
>     create unique index on something ( a, c );
>     create unique index on something ( b, c, a );
>
> i don't understand your cols 4-9, tho. is this what you're
> looking for?
>
Yes, thanks, thats what I was looking for.
Columns 4-9 are data that that corresponds to a unique
combination of b and c (and necessarily a).
Regards, Gary

> --
> There are 10 kinds of people:
> ones that get binary, and ones that don't.
>
> will@serensoft.com



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

Предыдущее
От: "Johnson, Shaunn"
Дата:
Сообщение: silly select question
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Functions and triggers can anyone help