public inbox for [email protected]help / color / mirror / Atom feed
[PATCH v6 5/7] Invalidate parent index cluster on attach 3+ messages / 3 participants [nested] [flat]
* [PATCH v6 5/7] Invalidate parent index cluster on attach @ 2020-11-06 01:11 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Justin Pryzby @ 2020-11-06 01:11 UTC (permalink / raw) --- src/backend/commands/indexcmds.c | 21 +++++++++++++++++++++ src/test/regress/expected/cluster.out | 14 ++++++++++++++ src/test/regress/sql/cluster.sql | 5 +++++ 3 files changed, 40 insertions(+) diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 0a65698c28..ffc809822b 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -4006,6 +4006,27 @@ IndexSetParentIndex(Relation partitionIdx, Oid parentOid) /* set relispartition correctly on the partition */ update_relispartition(partRelid, OidIsValid(parentOid)); + /* + * If the attached index is not clustered, invalidate cluster mark on + * any parents + */ + if ((OidIsValid(parentOid) && get_index_isclustered(parentOid)) || + get_index_isclustered(partRelid)) + { + Relation indrel; + + /* Make relispartition visible */ + CommandCounterIncrement(); + + indrel = table_open(IndexGetRelation(partRelid, false), + ShareUpdateExclusiveLock); + mark_index_clustered(indrel, + get_index_isclustered(partRelid) ? partRelid : InvalidOid, + true); + table_close(indrel, ShareUpdateExclusiveLock); + + } + if (fix_dependencies) { /* diff --git a/src/test/regress/expected/cluster.out b/src/test/regress/expected/cluster.out index 6d88978387..f0c962db75 100644 --- a/src/test/regress/expected/cluster.out +++ b/src/test/regress/expected/cluster.out @@ -567,6 +567,20 @@ Indexes: "clstrpart_idx" btree (a) Number of partitions: 3 (Use \d+ to list them.) +-- Check that attaching an unclustered index marks the parent unclustered: +ALTER TABLE clstrpart CLUSTER ON clstrpart_idx; +CREATE TABLE clstrpart5 (LIKE clstrpart INCLUDING INDEXES); +ALTER TABLE clstrpart ATTACH PARTITION clstrpart5 FOR VALUES FROM (40)TO(50); +\d clstrpart + Partitioned table "public.clstrpart" + Column | Type | Collation | Nullable | Default +--------+---------+-----------+----------+--------- + a | integer | | | +Partition key: RANGE (a) +Indexes: + "clstrpart_idx" btree (a) +Number of partitions: 4 (Use \d+ to list them.) + -- Test CLUSTER with external tuplesorting create table clstr_4 as select * from tenk1; create index cluster_sort on clstr_4 (hundred, thousand, tenthous); diff --git a/src/test/regress/sql/cluster.sql b/src/test/regress/sql/cluster.sql index c9bb204a93..ff7ffed6e4 100644 --- a/src/test/regress/sql/cluster.sql +++ b/src/test/regress/sql/cluster.sql @@ -239,6 +239,11 @@ CLUSTER clstrpart1 USING clstrpart1_idx_2; ALTER TABLE clstrpart CLUSTER ON clstrpart_idx; ALTER TABLE clstrpart1 SET WITHOUT CLUSTER; \d clstrpart +-- Check that attaching an unclustered index marks the parent unclustered: +ALTER TABLE clstrpart CLUSTER ON clstrpart_idx; +CREATE TABLE clstrpart5 (LIKE clstrpart INCLUDING INDEXES); +ALTER TABLE clstrpart ATTACH PARTITION clstrpart5 FOR VALUES FROM (40)TO(50); +\d clstrpart -- Test CLUSTER with external tuplesorting -- 2.17.0 --FsscpQKzF/jJk6ya Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v6-0006-Preserve-indisclustered-on-children-of-clustered-.patch" ^ permalink raw reply [nested|flat] 3+ messages in thread
* Fix untranslatable split message @ 2025-02-25 05:09 Kyotaro Horiguchi <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: Kyotaro Horiguchi @ 2025-02-25 05:09 UTC (permalink / raw) To: [email protected] Hello, The recent commit 1aab6805919 introduced a help description that was split into two printf() commands, making it untranslatable. The attached patch merges them into a single message. regards. -- Kyotaro Horiguchi NTT Open Source Software Center Attachments: [text/x-patch] 0001-Merge-split-string-literals-into-a-single-message.patch (1.4K, ../../[email protected]/2-0001-Merge-split-string-literals-into-a-single-message.patch) download | inline diff: From f946b02bbb4e30bc250bf7386556c970ddb7dfbd Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi <[email protected]> Date: Tue, 25 Feb 2025 13:57:03 +0900 Subject: [PATCH] Merge split string literals into a single message A recently added option description was split across two output commands, making the message untranslatable. Merge them into a single message. --- src/bin/pg_upgrade/option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c index fe716c4c805..188dd8d8a8b 100644 --- a/src/bin/pg_upgrade/option.c +++ b/src/bin/pg_upgrade/option.c @@ -323,8 +323,8 @@ usage(void) printf(_(" --copy copy files to new cluster (default)\n")); printf(_(" --copy-file-range copy files to new cluster with copy_file_range\n")); printf(_(" --no-statistics do not import statistics from old cluster\n")); - printf(_(" --set-char-signedness=OPTION set new cluster char signedness to \"signed\" or\n")); - printf(_(" \"unsigned\"\n")); + printf(_(" --set-char-signedness=OPTION set new cluster char signedness to \"signed\" or\n" + " \"unsigned\"\n")); printf(_(" --sync-method=METHOD set method for syncing files to disk\n")); printf(_(" -?, --help show this help, then exit\n")); printf(_("\n" -- 2.43.5 ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Fix untranslatable split message @ 2025-02-25 06:10 Michael Paquier <[email protected]> parent: Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2025-02-25 06:10 UTC (permalink / raw) To: Kyotaro Horiguchi <[email protected]>; +Cc: [email protected] On Tue, Feb 25, 2025 at 02:09:53PM +0900, Kyotaro Horiguchi wrote: > The recent commit 1aab6805919 introduced a help description that was > split into two printf() commands, making it untranslatable. > > The attached patch merges them into a single message. Good catch, you are right. Will fix. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc) download ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-02-25 06:10 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-11-06 01:11 [PATCH v6 5/7] Invalidate parent index cluster on attach Justin Pryzby <[email protected]> 2025-02-25 05:09 Fix untranslatable split message Kyotaro Horiguchi <[email protected]> 2025-02-25 06:10 ` Re: Fix untranslatable split message Michael Paquier <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox