Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly
Date
Msg-id 20191127040507.GK5435@paquier.xyz
Whole thread Raw
In response to Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Nov 27, 2019 at 12:54:16PM +0900, Michael Paquier wrote:
> +       /* Skip all mapped relations if TABLESPACE is specified */
> +       if (OidIsValid(tableSpaceOid) &&
> +           classtuple->relfilenode == 0)
> +       {
> +           if (!system_warning)
> +               ereport(WARNING,
> +                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> +                        errmsg("cannot move indexes of system relations, skipping all")));
> +           system_warning = true;
>             continue;
> It seems to me that you need to use RelationIsMapped() here, and we
> have no tests for it.  On top of that, we should warn about *both*
> for catalogs reindexes and mapped relation whose tablespaces are being
> changed once each.

Ditto.  This has been sent too quickly.  You cannot use
RelationIsMapped() here because there is no Relation at hand, but I
would suggest to use OidIsValid, and mention that this is the same
check as RelationIsMapped().
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Remove page-read callback from XLogReaderState.
Next
From: Alvaro Herrera
Date:
Subject: Re: Remove page-read callback from XLogReaderState.