Unique indices and inheritance

From: Bruce Guenter <bguenter-pgsql-general(at)qcc(dot)sk(dot)ca>
To: pgsql-general(at)hub(dot)org
Subject: Unique indices and inheritance
Date: 1999-03-26 06:16:56
Message-ID: 19990326001656.A23953@qcc.sk.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)guenter(at)qcc(dot)sk(dot)ca
Phone: (306)249-0220 WWW: http://www.qcc.sk.ca/~bguenter/

Browse pgsql-general by date

  From Date Subject
Next Message Ty Augustine 1999-03-26 06:32:33 How do I "Insert" using a type member?
Previous Message Rodney McDuff 1999-03-26 06:11:49 User defined function weirdness