Received: from access1.lan2wan.com (bmccoy@access1.lan2wan.com [205.177.8.10]) by hub.org (8.9.2/8.9.1) with ESMTP id QAA19169 for ; Fri, 19 Mar 1999 16:24:53 -0500 (EST) (envelope-from bmccoy@access1.lan2wan.com) Received: (from bmccoy@localhost) by access1.lan2wan.com (8.8.5/) id TAA23798; Fri, 19 Mar 1999 19:07:52 -0500 (EST) Date: Fri, 19 Mar 1999 19:07:51 -0500 (EST) From: "Brett W. McCoy" To: MESZAROS Attila cc: pgsql-sql@hub.org Subject: Re: [SQL] compound key In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 19 Mar 1999, MESZAROS Attila wrote: > I have seen the following stucture in AdabasD: > create table AttributeNames ( > id integer not null, > name varchar(200), > classId integer not null > ); > alter table AttributeNames add primary key (id,classId); > > I know, I can't create "compound key" using "alter table", but is there > any way to create one ? CREATE UNIQUE INDEX AttributeNames_pkey ON AttributeNames(id, classId); Or even create table AttributeNames ( id integer not null, name varchar(200), classId integer not null PRIMARY KEY(id, classId); ); Brett W. McCoy http://www.lan2wan.com/~bmccoy ----------------------------------------------------------------------- Labor, n.: One of the processes by which A acquires property for B. -- Ambrose Bierce, "The Devil's Dictionary" ----- BEGIN GEEK CODE BLOCK ----- Version: 3.12 GAT dpu s:-- a C++++ UL++++$ P+ L+++ E W++ N- o K- w--- O@ M-@ !V PS+++ PE Y+ PGP- t++ 5- X+ R+@ tv b+++ DI+++ D+ e>++ h+ r++ y++++ ------ END GEEK CODE BLOCK ------