Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 66646476E43 for ; Wed, 19 Jun 2002 11:02:55 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 5164B476D76 for ; Wed, 19 Jun 2002 10:48:32 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5JEmW104685; Wed, 19 Jun 2002 10:48:32 -0400 (EDT) To: Brian McCane Cc: Jean-Christophe ARNU , pgsql-admin@postgresql.org Subject: Re: index keeps on growing In-reply-to: <20020619093539.M29552-100000@fw.mccons.net> References: <20020619093539.M29552-100000@fw.mccons.net> Comments: In-reply-to Brian McCane message dated "Wed, 19 Jun 2002 09:37:06 -0500" Date: Wed, 19 Jun 2002 10:48:31 -0400 Message-ID: <4682.1024498111@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200206/140 X-Sequence-Number: 4574 Brian McCane writes: > Okay, thanks for that information. I will have to dig through my > pgsql-admin archive here and find the code for setting the primary key > flag. Unless of course someone would like to offer me the information > *HINT* :). If you'd like to be backwards-compatible with older backends, I think you need to reach in and set the indisprimary field of the pg_index row for the index. As of 7.2 or so there is an ALTER TABLE ADD PRIMARY KEY syntax that you could use instead of creating the index directly. This would be better since it doesn't require superuser privileges... regards, tom lane