2000-01-05 18:31:08 +01:00
|
|
|
VACUUM;
|
|
|
|
--
|
|
|
|
-- sanity check, if we don't have indices the test will take years to
|
2000-07-06 01:02:37 +02:00
|
|
|
-- complete. But skip TOAST relations since they will have varying
|
|
|
|
-- names depending on the current OID counter.
|
2000-01-05 18:31:08 +01:00
|
|
|
--
|
|
|
|
SELECT relname, relhasindex
|
1997-04-06 08:07:13 +02:00
|
|
|
FROM pg_class
|
2000-07-06 01:02:37 +02:00
|
|
|
WHERE relhasindex AND relkind != 't'
|
1997-04-06 08:07:13 +02:00
|
|
|
ORDER BY relname;
|
2000-01-05 18:31:08 +01:00
|
|
|
relname | relhasindex
|
|
|
|
---------------------+-------------
|
|
|
|
bt_f8_heap | t
|
|
|
|
bt_i4_heap | t
|
|
|
|
bt_name_heap | t
|
|
|
|
bt_txt_heap | t
|
2005-07-01 21:19:05 +02:00
|
|
|
circle_tbl | t
|
2000-01-05 18:31:08 +01:00
|
|
|
fast_emp4000 | t
|
2001-08-28 01:23:35 +02:00
|
|
|
func_index_heap | t
|
2000-01-05 18:31:08 +01:00
|
|
|
hash_f8_heap | t
|
|
|
|
hash_i4_heap | t
|
|
|
|
hash_name_heap | t
|
|
|
|
hash_txt_heap | t
|
|
|
|
ihighway | t
|
|
|
|
num_exp_add | t
|
|
|
|
num_exp_div | t
|
|
|
|
num_exp_ln | t
|
|
|
|
num_exp_log10 | t
|
|
|
|
num_exp_mul | t
|
|
|
|
num_exp_power_10_ln | t
|
|
|
|
num_exp_sqrt | t
|
|
|
|
num_exp_sub | t
|
|
|
|
onek | t
|
2001-07-16 07:07:00 +02:00
|
|
|
onek2 | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_aggregate | t
|
|
|
|
pg_am | t
|
|
|
|
pg_amop | t
|
2001-06-12 07:55:50 +02:00
|
|
|
pg_amproc | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_attrdef | t
|
|
|
|
pg_attribute | t
|
2005-06-28 07:09:14 +02:00
|
|
|
pg_auth_members | t
|
|
|
|
pg_authid | t
|
2005-07-14 07:13:45 +02:00
|
|
|
pg_autovacuum | t
|
2002-07-19 01:11:32 +02:00
|
|
|
pg_cast | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_class | t
|
2002-07-12 20:43:19 +02:00
|
|
|
pg_constraint | t
|
2002-07-11 09:39:28 +02:00
|
|
|
pg_conversion | t
|
2001-06-12 07:55:50 +02:00
|
|
|
pg_database | t
|
2002-07-12 20:43:19 +02:00
|
|
|
pg_depend | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_description | t
|
|
|
|
pg_index | t
|
|
|
|
pg_inherits | t
|
|
|
|
pg_language | t
|
2000-10-24 03:38:44 +02:00
|
|
|
pg_largeobject | t
|
2002-03-22 22:34:44 +01:00
|
|
|
pg_namespace | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_opclass | t
|
|
|
|
pg_operator | t
|
2005-09-08 22:07:42 +02:00
|
|
|
pg_pltemplate | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_proc | t
|
|
|
|
pg_rewrite | t
|
2005-07-07 22:40:02 +02:00
|
|
|
pg_shdepend | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_statistic | t
|
2004-06-18 08:14:31 +02:00
|
|
|
pg_tablespace | t
|
2000-01-05 18:31:08 +01:00
|
|
|
pg_trigger | t
|
|
|
|
pg_type | t
|
2005-07-01 21:19:05 +02:00
|
|
|
polygon_tbl | t
|
2000-01-05 18:31:08 +01:00
|
|
|
road | t
|
|
|
|
shighway | t
|
|
|
|
tenk1 | t
|
|
|
|
tenk2 | t
|
2005-09-08 22:07:42 +02:00
|
|
|
(58 rows)
|
1997-04-06 08:07:13 +02:00
|
|
|
|
2002-08-10 17:54:04 +02:00
|
|
|
--
|
|
|
|
-- another sanity check: every system catalog that has OIDs should have
|
|
|
|
-- a unique index on OID. This ensures that the OIDs will be unique,
|
|
|
|
-- even after the OID counter wraps around.
|
|
|
|
-- We exclude non-system tables from the check by looking at nspname.
|
|
|
|
--
|
|
|
|
SELECT relname, nspname
|
|
|
|
FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = relnamespace
|
|
|
|
WHERE relhasoids
|
|
|
|
AND ((nspname ~ '^pg_') IS NOT FALSE)
|
|
|
|
AND NOT EXISTS (SELECT 1 FROM pg_index i WHERE indrelid = c.oid
|
2003-05-28 18:04:02 +02:00
|
|
|
AND indkey[0] = -2 AND indnatts = 1 AND indisunique);
|
2002-08-10 17:54:04 +02:00
|
|
|
relname | nspname
|
|
|
|
---------+---------
|
|
|
|
(0 rows)
|
|
|
|
|