mirror of
https://github.com/postgres/postgres.git
synced 2025-12-07 12:02:30 +03:00
I attach a little patch to make CLUSTER set and reset the indisclustered
bit on the indexes. I also attach clusterdb and clusterdb.sgml; both of them are blatant rips of vacuumdb and vacuumdb.sgml, but get the job done. Please review them, as I'm probably making a lot of mistakes with SGML and I can't compile it here. vacuumdb itself is not very comfortable to use when the databases have passwords, because it has to connect once for each table (I can probably make it connect only once for each database; should I?). Because of this I added a mention of PGPASSWORDFILE in the documentation, but I don't know if that is the correct place for that. Alvaro Herrera
This commit is contained in:
@@ -274,3 +274,14 @@ FROM pg_class c WHERE relname LIKE 'clstr_tst%' ORDER BY relname;
|
||||
clstr_tst_s_rf_a_seq | S | f
|
||||
(11 rows)
|
||||
|
||||
-- Verify that indisclustered is correctly set
|
||||
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
|
||||
-------------
|
||||
clstr_tst_c
|
||||
(1 row)
|
||||
|
||||
|
||||
@@ -79,3 +79,10 @@ SELECT conname FROM pg_constraint WHERE conrelid = 'clstr_tst'::regclass;
|
||||
SELECT relname, relkind,
|
||||
EXISTS(SELECT 1 FROM pg_class WHERE oid = c.reltoastrelid) AS hastoast
|
||||
FROM pg_class c WHERE relname LIKE 'clstr_tst%' ORDER BY relname;
|
||||
|
||||
-- Verify that indisclustered is correctly set
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user