public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v9 7/8] Preserve indisclustered on children of clustered, partitioned indexes
2+ messages / 2 participants
[nested] [flat]

* [PATCH v9 7/8] Preserve indisclustered on children of clustered, partitioned indexes
@ 2020-10-07 01:40 Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Justin Pryzby @ 2020-10-07 01:40 UTC (permalink / raw)

Note, this takes a parentIndex, but that wasn't previously used ...
UpdateIndexRelation(Oid indexoid, Oid heapoid, Oid parentIndexId,
---
 src/backend/catalog/index.c           |  3 ++-
 src/test/regress/expected/cluster.out | 12 ++++++++++++
 src/test/regress/sql/cluster.sql      |  4 ++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4ef61b5efd..71649b38ee 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -604,7 +604,8 @@ UpdateIndexRelation(Oid indexoid,
 	values[Anum_pg_index_indisprimary - 1] = BoolGetDatum(primary);
 	values[Anum_pg_index_indisexclusion - 1] = BoolGetDatum(isexclusion);
 	values[Anum_pg_index_indimmediate - 1] = BoolGetDatum(immediate);
-	values[Anum_pg_index_indisclustered - 1] = BoolGetDatum(false);
+	values[Anum_pg_index_indisclustered - 1] = BoolGetDatum(OidIsValid(parentIndexId) &&
+												get_index_isclustered(parentIndexId));
 	values[Anum_pg_index_indisvalid - 1] = BoolGetDatum(isvalid);
 	values[Anum_pg_index_indcheckxmin - 1] = BoolGetDatum(false);
 	values[Anum_pg_index_indisready - 1] = BoolGetDatum(isready);
diff --git a/src/test/regress/expected/cluster.out b/src/test/regress/expected/cluster.out
index e7f0889743..a3943c13f5 100644
--- a/src/test/regress/expected/cluster.out
+++ b/src/test/regress/expected/cluster.out
@@ -581,6 +581,18 @@ Indexes:
     "clstrpart_idx" btree (a)
 Number of partitions: 4 (Use \d+ to list them.)
 
+-- Check that new children inherit clustered mark
+ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
+CREATE TABLE clstrpart4 PARTITION OF clstrpart FOR VALUES FROM (30)TO(40);
+\d clstrpart4
+             Table "public.clstrpart4"
+ Column |  Type   | Collation | Nullable | Default 
+--------+---------+-----------+----------+---------
+ a      | integer |           |          | 
+Partition of: clstrpart FOR VALUES FROM (30) TO (40)
+Indexes:
+    "clstrpart4_a_idx" btree (a) CLUSTER
+
 -- 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 3c8085c69e..22628e90ca 100644
--- a/src/test/regress/sql/cluster.sql
+++ b/src/test/regress/sql/cluster.sql
@@ -244,6 +244,10 @@ 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
+-- Check that new children inherit clustered mark
+ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
+CREATE TABLE clstrpart4 PARTITION OF clstrpart FOR VALUES FROM (30)TO(40);
+\d clstrpart4
 
 -- Test CLUSTER with external tuplesorting
 
-- 
2.17.0


--fmvA4kSBHQVZhkR6
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v9-0008-pg_dump-partitioned-index-depend-on-its-partition.patch"



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Fixes required for cross version update testing
@ 2023-01-14 00:33 Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Justin Pryzby @ 2023-01-14 00:33 UTC (permalink / raw)
  To: Andrew Dunstan <[email protected]>; +Cc: [email protected]; Michael Paquier <[email protected]>

On Fri, Jan 13, 2023 at 05:20:41PM -0500, Andrew Dunstan wrote:
> Over at [1] there was some discussion of moving knowledge of what's
> required to be fixed from old branch repos to be able to upgrade them
> into the core code, instead of having it reside in a buildfarm client
> module.

Is this instead of the idea for the buildfarm to use the same SQL script
as the TAP test (upgrade_adapt.sql) ?

Discussed various places:

https://www.postgresql.org/message-id/flat/[email protected]

https://github.com/PGBuildFarm/client-code/pull/23

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0df9641d39057f431655b92b8a490b89c...
|   The long-term plan is to make the buildfarm code re-use this new SQL
|   file, so as committers are able to fix any compatibility issues in the
|   tests of pg_upgrade with a refresh of the core code, without having to
|   poke at the buildfarm client.  Note that this is only able to handle the
|   main regression test suite, and that nothing is done yet for contrib
|   modules yet (these have more issues like their database names).

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=9814ff550046f825b751803191b29a2fb...

-- 
Justin






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-01-14 00:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 01:40 [PATCH v9 7/8] Preserve indisclustered on children of clustered, partitioned indexes Justin Pryzby <[email protected]>
2023-01-14 00:33 Re: Fixes required for cross version update testing Justin Pryzby <[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