Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / contrib / pgstattuple / pgstattuple.sql.in
blob002e274fd833a43b70e76e854ce4ab14a0c9bbb1
1 /* $PostgreSQL$ */
3 -- Adjust this setting to control where the objects get created.
4 SET search_path = public;
6 CREATE OR REPLACE FUNCTION pgstattuple(IN relname text,
7 OUT table_len BIGINT, -- physical table length in bytes
8 OUT tuple_count BIGINT, -- number of live tuples
9 OUT tuple_len BIGINT, -- total tuples length in bytes
10 OUT tuple_percent FLOAT8, -- live tuples in %
11 OUT dead_tuple_count BIGINT, -- number of dead tuples
12 OUT dead_tuple_len BIGINT, -- total dead tuples length in bytes
13 OUT dead_tuple_percent FLOAT8, -- dead tuples in %
14 OUT free_space BIGINT, -- free space in bytes
15 OUT free_percent FLOAT8) -- free space in %
16 AS 'MODULE_PATHNAME', 'pgstattuple'
17 LANGUAGE C STRICT;
19 CREATE OR REPLACE FUNCTION pgstattuple(IN reloid oid,
20 OUT table_len BIGINT, -- physical table length in bytes
21 OUT tuple_count BIGINT, -- number of live tuples
22 OUT tuple_len BIGINT, -- total tuples length in bytes
23 OUT tuple_percent FLOAT8, -- live tuples in %
24 OUT dead_tuple_count BIGINT, -- number of dead tuples
25 OUT dead_tuple_len BIGINT, -- total dead tuples length in bytes
26 OUT dead_tuple_percent FLOAT8, -- dead tuples in %
27 OUT free_space BIGINT, -- free space in bytes
28 OUT free_percent FLOAT8) -- free space in %
29 AS 'MODULE_PATHNAME', 'pgstattuplebyid'
30 LANGUAGE C STRICT;
32 CREATE OR REPLACE FUNCTION pgstatindex(IN relname text,
33 OUT version INT,
34 OUT tree_level INT,
35 OUT index_size BIGINT,
36 OUT root_block_no BIGINT,
37 OUT internal_pages BIGINT,
38 OUT leaf_pages BIGINT,
39 OUT empty_pages BIGINT,
40 OUT deleted_pages BIGINT,
41 OUT avg_leaf_density FLOAT8,
42 OUT leaf_fragmentation FLOAT8)
43 AS 'MODULE_PATHNAME', 'pgstatindex'
44 LANGUAGE C STRICT;
46 CREATE OR REPLACE FUNCTION pg_relpages(IN relname text)
47 RETURNS BIGINT
48 AS 'MODULE_PATHNAME', 'pg_relpages'
49 LANGUAGE C STRICT;