Re: 回复:how to create index concurrently on partitioned table
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: 李杰(慎追) <adger.lj@alibaba-inc.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>, 曾文旌(义从) <wenjing.zwj@alibaba-inc.com>, Alvaro Herrera <alvherre@2ndquadrant.com>
Date: 2020-08-12T05:28:20Z
Lists: pgsql-hackers
Thanks for helping with this.
On Wed, Aug 12, 2020 at 01:54:38PM +0900, Michael Paquier wrote:
> +++ b/src/backend/catalog/index.c
> @@ -3661,20 +3662,12 @@ reindex_relation(Oid relid, int flags, int options)
> + elog(ERROR, "unsupported relation kind for relation \"%s\"",
> + RelationGetRelationName(rel));
I guess it should show the relkind(%c) in the message, like these:
src/backend/commands/tablecmds.c: elog(ERROR, "unexpected relkind: %d", (int) relkind);
src/backend/tcop/utility.c: elog(ERROR, "unexpected relkind \"%c\" on partition \"%s\"",
ISTM reindex_index is missing that, too:
8b08f7d4820fd7a8ef6152a9dd8c6e3cb01e5f99
+ if (iRel->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
+ elog(ERROR, "unsupported relation kind for index \"%s\"",
+ RelationGetRelationName(iRel));
> diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
> @@ -259,8 +263,12 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
> </para>
>
> <para>
> - Reindexing partitioned tables or partitioned indexes is not supported.
> - Each individual partition can be reindexed separately instead.
> + Reindexing partitioned indexes or partitioned tables is supported
> + with respectively <command>REINDEX INDEX</command> or
> + <command>REINDEX TABLE</command>.
Should say "..with REINDEX INDEX or REINDEX TABLE, respectively".
> + Each partition of the partitioned
> + relation defined is rebuilt in its own transaction.
=> Each partition of the specified partitioned relation is reindexed in a
separate transaction.
--
Justin
Commits
-
Allow CLUSTER on partitioned tables
- cfdd03f45e6a 15.0 landed
-
Add support for partitioned tables and indexes in REINDEX
- a6642b3ae060 14.0 landed
-
Local partitioned indexes
- 8b08f7d4820f 11.0 cited