Re: Cluster and primary key

From: Mathijs Brands <mathijs(at)ilse(dot)nl>
To: Mikael Kjellström <mikael(dot)kjellstrom(at)_no_spam_flygtaxi(dot)se>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Cluster and primary key
Date: 2001-06-12 17:03:42
Message-ID: 20010612190342.A8203@ilse.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Jun 05, 2001 at 07:51:11AM +0000, Mikael Kjellström allegedly wrote:
> I can't find a way to cluster a table on another index and keep it's
> primary key.
>
> When I define the table the primary key is created, but it's dropped when I
> cluster the table on another index.
>
> I've tried "alter table add constraint", but that's not supported for
> primary keys.
>
> I'm running 7.1.release4 on Debian Woody.

That can't be helped. The current cluster implementation drops all indexes on
the table you're clustering, with the exception of the index you're clustering
on. You could work around this limitation in the current cluster implementation
by recreating the index enforcing the primary key.

I hope this is of help to you,

Mathijs
--
"A book is a fragile creature. It suffers the wear of time,
it fears rodents, the elements, clumsy hands."
Umberto Eco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alex Pilosov 2001-06-12 17:15:27 Re: PL/PGSQL
Previous Message Stephan Szabo 2001-06-12 17:01:29 Re: Foreign key to base table with rows in inherited tables