mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Adapt for SRF(Set Returning Function).
This commit is contained in:
@ -1,4 +1,16 @@
|
||||
DROP FUNCTION pgstattuple(text);
|
||||
CREATE FUNCTION pgstattuple(text) RETURNS float8
|
||||
AS 'MODULE_PATHNAME', 'pgstattuple'
|
||||
LANGUAGE 'c' WITH (isstrict);
|
||||
DROP VIEW pgstattuple_view CASCADE;
|
||||
CREATE VIEW pgstattuple_view AS
|
||||
SELECT
|
||||
0::BIGINT AS table_len, -- physical table length in bytes
|
||||
0::BIGINT AS tuple_count, -- number of live tuples
|
||||
0::BIGINT AS tuple_len, -- total tuples length in bytes
|
||||
0.0::FLOAT AS tuple_percent, -- live tuples in %
|
||||
0::BIGINT AS dead_tuple_count, -- number of dead tuples
|
||||
0::BIGINT AS dead_tuple_len, -- total dead tuples length in bytes
|
||||
0.0::FLOAT AS dead_tuple_percent, -- dead tuples in %
|
||||
0::BIGINT AS free_space, -- free space in bytes
|
||||
0.0::FLOAT AS free_percent; -- free space in %
|
||||
|
||||
CREATE OR REPLACE FUNCTION pgstattuple(text) RETURNS SETOF pgstattuple_view
|
||||
AS 'MODULE_PATHNAME', 'pgstattuple'
|
||||
LANGUAGE 'c' WITH (isstrict);
|
||||
|
Reference in New Issue
Block a user