Re: INSERT UNIQUE row?

Поиск
Список
Период
Сортировка
От Christophe Pettus
Тема Re: INSERT UNIQUE row?
Дата
Msg-id 6669E40E-A427-4121-96FC-E4D90BFA6806@thebuild.com
обсуждение исходный текст
Ответ на INSERT UNIQUE row?  (pf@pfortin.com)
Список pgsql-general
A UNIQUE index can have any number of columns, so you can create an index with all of the appropriate columns listed.
Thisis different from having a UNIQUE index on each individual column.  In the former case, all of the columns together
mustbe unique; in the latter case, as you mention, each index is evaluated separately. 

> On Jul 9, 2023, at 15:58, pf@pfortin.com wrote:
>
> Hi,
>
> Trying to figure out how to insert new property addresses into an
> existing table.
>
> Can a UNIQUE constraint be applied to an entire row?  Adding UNIQUE to
> each column won't work in such a case since there are multiple properties
> * on the same street
> * in the same town
> * with the same number on different streets
> * etc...
>
> Each row is only unique as an entity; but the columns are not...
>
> Is this covered in the docs?
>
> Thanks,
> Pierre
>
>
>




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

Предыдущее
От: pf@pfortin.com
Дата:
Сообщение: INSERT UNIQUE row?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: INSERT UNIQUE row?