Tablespaces and primary keys

From: Wes <wespvp(at)syntegra(dot)com>
To: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Tablespaces and primary keys
Date: 2005-01-25 03:03:29
Message-ID: BE1B1321.21E4%wespvp@syntegra.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Implicit indexes created by a constraint do not appear to honor the default
tablespace. The index gets created in the "null" tablespace.

I took pg_dumpall output and modified the schema to place everything in
specific table spaces. When the statement:

ALTER TABLE ONLY addresses
ADD CONSTRAINT addresses_pkey PRIMARY KEY (address_key);

is executed, this results in an implicitly created index:

NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
"addresses_pkey" for table "addresses"

However, it ignores my previous command:

SET default_tablespace = indexes;

and creates the index without a tablespace. Of course, I can do an

ALTER INDEX addresses_pkey SET tablespace indexes;

but that's a bit of a hassle where there are a number of very large indexes.

I can't pre-create the index, as the constraint will try to create it's own
index anyway.

Is there something I'm overlooking, or is this a bug?

Wes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-01-25 03:05:56 Re: What is the format of 'binary' data in the postgresql client/server protocol version 3
Previous Message Jim C. Nasby 2005-01-25 02:34:48 Re: Recursive queries