Unique indices and inheritance - Mailing list pgsql-general

From Bruce Guenter
Subject Unique indices and inheritance
Date
Msg-id 19990326001656.A23953@qcc.sk.ca
Whole thread Raw
List pgsql-general
Greetings.

In the following situation:
    create table foo (id int4);
    create table bar (val int4) inherits(foo);
Is it possible to create a unique index such that no record in either
foo or bar (in other words, in foo*) has a duplicated id?  I tried what
seemed to be most obvious to me by doing:
    create unique index foo_pkey on foo*(id);
but it caused a syntax error.  Creating a unique index on just foo
allows duplicates between the two tables.
--
Bruce Guenter, QCC Communications Corp.  EMail: bruce.guenter@qcc.sk.ca
Phone: (306)249-0220               WWW: http://www.qcc.sk.ca/~bguenter/

pgsql-general by date:

Previous
From: Rodney McDuff
Date:
Subject: User defined function weirdness
Next
From: "Ty Augustine"
Date:
Subject: How do I "Insert" using a type member?