Search Postgresql Archives

Tablespaces and primary keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux