Directly associate primary key with user-defined tablespace
Directly associate primary key with user-defined tablespace
От:
MichaelDBA <MichaelDBA@sqlexec.com>
Дата:
Hi all!
PG by default always creates the primary key in the default tablespace unless you specify it to use an index that is defined in a user-defined tablespace.
We can create indexes in user-defined tablespaces, why can't we create a primary key in a user-defined tablespace without having to associate it with an index? Something like:
ALTER TABLE myschema.mytable ADD PRIMARY KEY (akey) tablespace mytablespace;
PG by default always creates the primary key in the default tablespace unless you specify it to use an index that is defined in a user-defined tablespace.
We can create indexes in user-defined tablespaces, why can't we create a primary key in a user-defined tablespace without having to associate it with an index? Something like:
ALTER TABLE myschema.mytable ADD PRIMARY KEY (akey) tablespace mytablespace;
Regards,
Michael Vitale