mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
OK, here's the final version of ALTER TABLE ... SET WITHOUT CLUSTER.
Has docs + regression test. Christopher Kings-Lynne
This commit is contained in:
@@ -297,6 +297,17 @@ WHERE pg_class.oid=indexrelid
|
||||
clstr_tst_b_c
|
||||
(1 row)
|
||||
|
||||
-- Try turning off all clustering
|
||||
ALTER TABLE clstr_tst SET WITHOUT CLUSTER;
|
||||
SELECT pg_class.relname FROM pg_index, pg_class, pg_class AS pg_class_2
|
||||
WHERE pg_class.oid=indexrelid
|
||||
AND indrelid=pg_class_2.oid
|
||||
AND pg_class_2.relname = 'clstr_tst'
|
||||
AND indisclustered;
|
||||
relname
|
||||
---------
|
||||
(0 rows)
|
||||
|
||||
-- Verify that clustering all tables does in fact cluster the right ones
|
||||
CREATE USER clstr_user;
|
||||
CREATE TABLE clstr_1 (a INT PRIMARY KEY);
|
||||
|
||||
@@ -95,6 +95,14 @@ WHERE pg_class.oid=indexrelid
|
||||
AND pg_class_2.relname = 'clstr_tst'
|
||||
AND indisclustered;
|
||||
|
||||
-- Try turning off all clustering
|
||||
ALTER TABLE clstr_tst SET WITHOUT CLUSTER;
|
||||
SELECT pg_class.relname FROM pg_index, pg_class, pg_class AS pg_class_2
|
||||
WHERE pg_class.oid=indexrelid
|
||||
AND indrelid=pg_class_2.oid
|
||||
AND pg_class_2.relname = 'clstr_tst'
|
||||
AND indisclustered;
|
||||
|
||||
-- Verify that clustering all tables does in fact cluster the right ones
|
||||
CREATE USER clstr_user;
|
||||
CREATE TABLE clstr_1 (a INT PRIMARY KEY);
|
||||
|
||||
Reference in New Issue
Block a user