Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly
Дата
Msg-id 20190919044300.GB21144@paquier.xyz
обсуждение исходный текст
Ответ на Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly  (Alexey Kondratov <a.kondratov@postgrespro.ru>)
Ответы Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly  (Alexey Kondratov <a.kondratov@postgrespro.ru>)
Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Sep 18, 2019 at 03:46:20PM +0300, Alexey Kondratov wrote:
> Currently in Postgres SET TABLESPACE always comes with [ NOWAIT ] option, so
> I hope it worth adding this option here for convenience. Added in the new
> version.

It seems to me that it would be good to keep the patch as simple as
possible for its first version, and split it into two if you would
like to add this new option instead of bundling both together.  This
makes the review of one and the other more simple.  Anyway, regarding
the grammar, is SET TABLESPACE really our best choice here?  What
about:
- TABLESPACE = foo, in parenthesis only?
- Only using TABLESPACE, without SET at the end of the query?

SET is used in ALTER TABLE per the set of subqueries available there,
but that's not the case of REINDEX.

+-- check that all relations moved to new tablespace
+SELECT relname FROM pg_class
+WHERE reltablespace=(SELECT oid FROM pg_tablespace WHERE
spcname='regress_tblspace')
+AND relname IN ('regress_tblspace_test_tbl_idx');
+            relname
+-------------------------------
+ regress_tblspace_test_tbl_idx
+(1 row)
Just to check one relation you could use \d with the relation (index
or table) name.

-   if (RELATION_IS_OTHER_TEMP(iRel))
-       ereport(ERROR,
-               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                errmsg("cannot reindex temporary tables of other
-       sessions")))
I would keep the order of this operation in order with
CheckTableNotInUse().
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mitar
Дата:
Сообщение: Re: Feature request: binary NOTIFY
Следующее
От: "Smith, Peter"
Дата:
Сообщение: RE: Proposal: Add more compile-time asserts to exposeinconsistencies.