|
|
|
@ -135,9 +135,45 @@ SELECT |
|
|
|
|
'stats_import.testview'::regclass); |
|
|
|
|
ERROR: cannot modify statistics for relation "testview" |
|
|
|
|
DETAIL: This operation is not supported for views. |
|
|
|
|
-- relpages may be -1 for partitioned tables |
|
|
|
|
CREATE TABLE stats_import.part_parent ( i integer ) PARTITION BY RANGE(i); |
|
|
|
|
CREATE TABLE stats_import.part_child_1 |
|
|
|
|
PARTITION OF stats_import.part_parent |
|
|
|
|
FOR VALUES FROM (0) TO (10); |
|
|
|
|
ANALYZE stats_import.part_parent; |
|
|
|
|
SELECT relpages |
|
|
|
|
FROM pg_class |
|
|
|
|
WHERE oid = 'stats_import.part_parent'::regclass; |
|
|
|
|
relpages |
|
|
|
|
---------- |
|
|
|
|
-1 |
|
|
|
|
(1 row) |
|
|
|
|
|
|
|
|
|
-- although partitioned tables have no storage, setting relpages to a |
|
|
|
|
-- positive value is still allowed |
|
|
|
|
SELECT |
|
|
|
|
pg_catalog.pg_set_relation_stats( |
|
|
|
|
relation => 'stats_import.part_parent'::regclass, |
|
|
|
|
relpages => 2::integer); |
|
|
|
|
pg_set_relation_stats |
|
|
|
|
----------------------- |
|
|
|
|
t |
|
|
|
|
(1 row) |
|
|
|
|
|
|
|
|
|
-- nothing stops us from setting it to -1 |
|
|
|
|
SELECT |
|
|
|
|
pg_catalog.pg_set_relation_stats( |
|
|
|
|
relation => 'stats_import.part_parent'::regclass, |
|
|
|
|
relpages => -1::integer); |
|
|
|
|
pg_set_relation_stats |
|
|
|
|
----------------------- |
|
|
|
|
t |
|
|
|
|
(1 row) |
|
|
|
|
|
|
|
|
|
DROP SCHEMA stats_import CASCADE; |
|
|
|
|
NOTICE: drop cascades to 4 other objects |
|
|
|
|
NOTICE: drop cascades to 5 other objects |
|
|
|
|
DETAIL: drop cascades to type stats_import.complex_type |
|
|
|
|
drop cascades to table stats_import.test |
|
|
|
|
drop cascades to sequence stats_import.testseq |
|
|
|
|
drop cascades to view stats_import.testview |
|
|
|
|
drop cascades to table stats_import.part_parent |
|
|
|
|