Search Postgresql Archives

Re: INSERT UNIQUE row?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A UNIQUE index can have any number of columns, so you can create an index with all of the appropriate columns listed.  This is different from having a UNIQUE index on each individual column.  In the former case, all of the columns together must be unique; in the latter case, as you mention, each index is evaluated separately.

> On Jul 9, 2023, at 15:58, pf@xxxxxxxxxxx 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
> 
> 
> 







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux