Re: create table with multiple unique fields

From: "Ed Yu" <ekyu(at)sc(dot)rr(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: create table with multiple unique fields
Date: 2002-01-07 05:02:09
Message-ID: lZ9_7.53230$8e2.17249828@typhoon.southeast.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

create a unique index on all three columns, a subsequence insert of existing
combination should error out.

"Karl Raven" <lcaasia(at)pd(dot)jaring(dot)my> wrote in message
news:a1b1fs$t0a$1(at)news(dot)tht(dot)net(dot)(dot)(dot)
> Hi,
>
> I'd like to create a table with 3 create unique fields :
>
> fields
> warehouseno,loc, productid, qty, qtyalllocated
>
> i'd like warehouseno,loc, productid to be unique..
> meaning
> 2000, ABC, X - ok
> 2000,ABC,Y -ok
> 2000,ABC,X - reject
> 2000,BCD,X - ok
>
> anyone knows how to do so?
>
> thanks
>
>
>
>

Browse pgsql-general by date

  From Date Subject
Next Message Arsalan Zaidi 2002-01-07 06:26:12 Re: Turning off transactions completely.
Previous Message Calvin Dodge 2002-01-07 03:38:31 Re: tune up memory consumption for disk caching