mirror of https://github.com/postgres/postgres
to the table function, thus preventing memory leakage accumulation across calls. This means that SRFs need to be careful to distinguish permanent and local storage; adjust code and documentation accordingly. Patch by Joe Conway, very minor tweaks by Tom Lane.REL7_3_STABLE
parent
0201dac1c3
commit
e4186762ff
@ -1,16 +1,16 @@ |
|||||||
DROP VIEW pgstattuple_view CASCADE; |
DROP TYPE pgstattuple_type CASCADE; |
||||||
CREATE VIEW pgstattuple_view AS |
CREATE TYPE pgstattuple_type AS ( |
||||||
SELECT |
table_len BIGINT, -- physical table length in bytes |
||||||
0::BIGINT AS table_len, -- physical table length in bytes |
tuple_count BIGINT, -- number of live tuples |
||||||
0::BIGINT AS tuple_count, -- number of live tuples |
tuple_len BIGINT, -- total tuples length in bytes |
||||||
0::BIGINT AS tuple_len, -- total tuples length in bytes |
tuple_percent FLOAT, -- live tuples in % |
||||||
0.0::FLOAT AS tuple_percent, -- live tuples in % |
dead_tuple_count BIGINT, -- number of dead tuples |
||||||
0::BIGINT AS dead_tuple_count, -- number of dead tuples |
dead_tuple_len BIGINT, -- total dead tuples length in bytes |
||||||
0::BIGINT AS dead_tuple_len, -- total dead tuples length in bytes |
dead_tuple_percent FLOAT, -- dead tuples in % |
||||||
0.0::FLOAT AS dead_tuple_percent, -- dead tuples in % |
free_space BIGINT, -- free space in bytes |
||||||
0::BIGINT AS free_space, -- free space in bytes |
free_percent FLOAT -- free space in % |
||||||
0.0::FLOAT AS free_percent; -- free space in % |
); |
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION pgstattuple(text) RETURNS SETOF pgstattuple_view |
CREATE OR REPLACE FUNCTION pgstattuple(text) RETURNS pgstattuple_type |
||||||
AS 'MODULE_PATHNAME', 'pgstattuple' |
AS 'MODULE_PATHNAME', 'pgstattuple' |
||||||
LANGUAGE 'c' WITH (isstrict); |
LANGUAGE 'c' WITH (isstrict); |
||||||
|
Loading…
Reference in new issue