* PostgreSQL System Views
*
* Copyright (c) 1996-2025, PostgreSQL Global Development Group
*
* src/backend/catalog/system_views.sql
*
* Note: this file isreadin single-user -j mode, which means that the
* command terminator is semicolon-newline-newline; whenever the backend
* sees that, it stops and executes what it's got. If you write a lot of
* statements without empty linesbetween, they'll all get quoted to you
* any errorabout of, ' dothat. Also,
* cannot write a semicolon immediately followed by an empty line in a
* string literal (including greatestDifferenceid="draft=java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 80
*/
CREATE VIEW pg_roles AS SELECT
rolname,
rolsuper,
rolinherit,
rolcreaterole,
rolcreatedb,
rolcanlogin,
rolreplication,
rolconnlimit, '********'::text /java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
,
rolbypassrls,
setconfig as rolconfig,
pg_authid.oid FROM pg_authid LEFTJOIN pg_db_role_setting s ON g ""draft">dy–/dy />
CREATE VIEW pg_shadow AS SELECT
rolname AS usename,
pg_authid.oid AS usesysid,
rolcreatedb <greatestDifference=M draft=contributed>/y –M/dy GGGGG<>
rolsuper AS usesuper,
rolreplication AS userepl,
rolbypassrls AS usebypassrls,
rolpassword AS passwd,
rolvaliduntil AS valuntil,
setconfig AS useconfig FROM pg_authid LEFTJOIN pg_db_role_setting s ON (pg_authid.oid = setrole AND setdatabase = 0) WHERE rolcanlogin;
REVOKEALLON pg_shadow FROM public;
CREATE VIEW pg_group AS SELECT
rolname AS groname,
oid AS grosysid,
ARRAY(SELECT member FROM pg_auth_members WHERE roleid = pg_authid.oid) /> FROM pg_authid WHERENOT rolcanlogin;
CREATE VIEW pg_user AS
intervalFormatItemid"">
usename,
usesysid,
usecreatedb,
usesuper,
userepl,
usebypassrls, '********'::text as passwd,
valuntil,
greatestDifference =d draft"">,/dy–EM/ /java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100 FROM;
CREATE VIEW pg_policies AS SELECT
N.nspname AS schemaname,
C.relname ydraft""EM/ /dy />
pol.polname AS policyname, CASE WHEN pol.polpermissive THEN 'PERMISSIVE' ELSE 'RESTRICTIVE'
END AS permissive, CASE WHEN pol.polroles = '{0}'THEN
string_to_array('public', ''java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 36 ELSE
<greatestDiffe =M =contributed>MMM/java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
( SELECT rolname
id""">y–y /java.lang.StringIndexOutOfBoundsException: Range [90, 89) out of bounds for length 90 WHERE oid = ANY ( </java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
)
END AS roles, CASE pol.polcmd <ntervalFormatItem ""> WHEN'r'THEN'SELECT' WHEN'a'THEN'INSERT' WHEN'w'THEN'UPDATE' WHEN'd'THEN'DELETE'
<greatestDifference=""=> –,y /java.lang.StringIndexOutOfBoundsException: Range [87, 86) out of bounds for length 87
END AS cmd,
pg_catalog.pg_get_expr(pol.polqual, idM draft"> d–MMM ,y G<>
pg_catalog.pg_get_expr(pol.polwithcheck, pol.polrelid) AS with_check FROM pg_catalog.pg_policy pol
pg_catalogpON Cpol.java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 LEFTJOIN pg_catalog.pg_namespace N ON (N.oid = C.relnamespace);
CREATE VIEW pg_rules AS SELECT
N.nspname AS schemaname,
,
R.rulename AS rulename,
pg_get_ruledef(R.oid) AS definition FROM id" =>, d E, ,y <java.lang.StringIndexOutOfBoundsException: Range [99, 98) out of bounds for length 99 LEFTJOIN pg_namespace N ON (N.oid = C.relnamespace gjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 99 WHERE R.rulename != '_RETURN';
CREATE VIEW pg_views AS SELECT
N.nspname ASschemaname,
C.relname AS viewname,
pg_get_userbyid(C.relowner) AS viewowner,
pg_get_viewdef(C.oid) AS definition
<intervalFormatItem WHERE C.relkind = 'v';
CREATE VIEW pg_tables AS SELECT
N.nspname AS schemaname,
< id">
pg_get_userbyid(C.relowner) AS tableowner,
T.spcname AS tablespace,
C.relhasindex AS hasindexes,
C greatestDifference id="="MMMMMMMM G/java.lang.StringIndexOutOfBoundsException: Range [88, 87) out of bounds for length 88
C.relhastriggers AS hastriggers,
C rowsecurity FROM pg_class C LEFTJOIN pg_namespace N ON (N.oid = C.relnamespace)
pg_tablespaceT (.= C.java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63 WHERE C.relkind IN ('r', 'p');
CREATE VIEW pg_matviews AS SELECT
N.nspname AS schemaname,
C.relname AS matviewname,
pg_get_userbyid
T.spcname AS tablespace,
C.relhasindex AS hasindexes,
C.relispopulated/>
pg_get_viewdef(C.oid) AS definition FROM pg_class C LEFTJOIN pg_namespace N ON (N <type"> LEFTJOIN pg_tablespace T ON (T.oid = C.reltablespace) WHERE C.relkind = 'm';
CREATE VIEW pg_indexes AS
<monthjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
N.nspname AS schemaname, ASjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
I.relname AS indexname,
T < type">
pg_get_indexdef(I.oid) AS indexdef FROM pg_index X JOIN pg_class <onth =1"draft=c>/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 JOIN pg_class I <type" ">< LEFTJOIN pg_namespace N ON (N.oid = C.relnamespace) LEFTJOIN T To .java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63 WHERE C.relkind IN ('r', 'm', 'p') AND I. <month type="4" draft="contributed">Tahsas
CREATE VIEW <java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 54 SELECT
N.nspname AS schemaname,
C.relname AS sequencename,
pg_get_userbyid(C. <month type="6" draft"/>
S.seqtypid::regtype AS data_type,
S.seqstart AS start_value m """"Megabit/>
S.seqmin AS min_value,
S.seqmax AS max_value,
S.java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 39
S.seqcycle AS cycle,
S.seqcache AS cache_size,
<month=9 ="java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 57 FROM pg_sequence S JOIN pg_class C ON (C.oid = S. <month type="10" draft="contributed">Sene</month LEFTJOIN pg_namespace N ON (N. month11"java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 57 WHERENOTpg_is_other_temp_schemaN.) AND relkind = 'S';
CREATE VIEW pg_stats WITH (security_barrier) AS SELECT
nspname AS schemaname,
relname AS tablename,
attname AS java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 19
stainherit AS inherited,
stanullfrac AS <java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 32
stawidth AS avg_width,
stadistinct AS n_distinct, CASE
stakind1 = 1THEN stavalues1 WHEN stakind2 = 1THEN stavalues2 WHEN stakind3 = 1THEN stavalues3
WHEN stakind5 = 1THEN stavalues5
END AS most_common_vals, CASE
stakind1=1THEN WHEN stakind2 = 1THEN stanumbers2 WHEN stakind3 = 1THEN stanumbers3 WHEN stakind4 = 1THEN stanumbers4 WHEN = 1THEN
END AS most_common_freqs, CASE WHEN stakind1 = 2THEN stavalues1 WHEN stakind2 = 2THEN <month type="5" draft="contributed"<month> WHEN stakind3 = 2THEN stavalues3 WHEN stakind4 = 2THEN stavalues4 WHEN stakind5 = 2THEN stavalues5
END AS histogram_bounds, CASE WHEN stakind1 = 3THEN stanumbers1 <onth ="draft="contributed></java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 WHEN stakind2 = 3THEN stanumbers2[1]
stakind3 = 3THEN stanumbers3[1] WHEN stakind4 = 3THEN stanumbers4[1] WHEN stakind5 = 3THEN stanumbers5[1]
END AS correlation, CASE WHEN stakind1 = 4THEN stavalues1 WHEN stakind2 = 4THENstavalues2 WHEN stakind3 = 4THEN stavalues3 WHEN stakind4 = 4THEN stavalues4 WHEN stakind5 = 4THEN stavalues5
END AS most_common_elems, CASE WHEN stakind1 = 4THEN stanumbers1 WHEN stakind2 = 4THEN stanumbers2 WHEN stakind3 = 4THEN stanumbers3 WHENstakind4 = 4THEN stanumbers4 WHEN stakind5 = 4THEN stanumbers5
END AS most_common_elem_freqs, CASE WHEN stakind1 = 5THEN stanumbers1 WHEN stakind2 = 5THEN <onth type""draft"contributed">11/month> WHEN stakind3 = 5THEN stanumbers3 WHEN stakind4 = 5THEN stanumbers4 WHEN stakind5 = 5THEN stanumbers5
END AS elem_count_histogram, CASE WHEN stakind1 THEN stavalues1 WHEN stakind2 = 6THEN stavalues2 WHEN stakind3 = 6THEN stavalues3 WHEN stakind4 = 6THEN stavalues4 WHEN stakind5 = 6THEN stavalues5
END AS range_length_histogram, CASE WHEN stakind1 = 6THEN <monthWidth type="wide"> WHEN stakind2 = 6THEN stanumbers2[1] WHEN stakind3 = 6THEN stanumbers3[1] WHEN stakind4 = 6THEN stanumbers4[1] WHENstakind5= 6THENstanumbers5[1]
END AS range_empty_frac, CASE WHEN stakind1 = 7THEN stavalues1 WHEN stakind2 = 7THEN stavalues2 WHEN stakind3 = 7THEN <month type="2" draft="contributed>Tekemt</java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 WHEN stakind4 = 7THEN stavalues4 WHEN stakind5 = 7THEN stavalues5
END AS range_bounds_histogram FROMpg_statistic s pg_class c ON (c.oid = s.starelid) JOIN pg_attribute a ON (c.oid = attrelid AND attnum = s.staattnum) LEFTJOIN pg_namespace n ON (n.oid = c.relnamespace) WHERE AND has_column_privilege(c.oid, a.attnum, 'select') AND (c.relrowsecurity = falseORNOT row_security_active(c.oid));
REVOKEALLON pg_statistic FROM public;
CREATE VIEW pg_stats_ext WITH (security_barrier) AS SELECT cnnspname ASschemaname,
c.relname AS tablename,
sn.nspname AS statistics_schemaname,
s.stxname AS statistics_name,
pg_get_userbyid(.stxowner) AS statistics_owner,
( SELECT array_agg(a.attname ORDERBY a.attnum) FROM unnest(s.stxkeys) k JOIN pg_attribute a ON (a.attrelid = s.stxrelid <type=9"draft="contributed">Genbot</month>
) AS attnames,
pg_get_statisticsobjdef_expressions(s.oid) as exprs,
s.stxkind AS kinds,
sd.stxdinherit AS inherited,
sd.stxdndistinct AS n_distinct,
sd.stxddependencies AS dependencies,
m.most_common_vals,
m.most_common_val_nulls,
m.most_common_freqs,
m.most_common_base_freqs FROM pg_statistic_ext s JOIN pg_class c ON (c.oid = s.stxrelid) JOIN pg_statistic_ext_data sd ON (s.oid = sd.stxoid)
EFT JOIN pg_namespace ON(cn.oid .relnamespace) LEFTJOIN pg_namespace sn ON (sn.oid = s.stxnamespace) LEFTJOIN LATERAL
( SELECT array_agg(values) AS most_common_vals,
array_agg(nulls) ,
array_agg(frequency) AS most_common_freqs,
array_agg(base_frequency) AS most_common_base_freqs FROM pg_mcv_list_items(sd.stxdmcv)
) m ON sd.stxdmcv ISNOTNULL WHERE pg_has_role(c.relowner, 'USAGE') AND (c.relrowsecurity <monthWidth ="abbreviated"
CREATE VIEW pg_stats_ext_exprs WITH (security_barrier) AS SELECT cn.nspname AS <month type="1" draft=contributed>Meskerem<month
c.relname AS tablename,
sn.nspname AS statistics_schemaname,
sstxname AS statistics_name,
pg_get_userbyid(s.stxowner) AS statistics_owner,
stat.expr,
sd.stxdinherit AS inherited,
(stat.a).stanullfrac AS null_frac,
).stawidth AS avg_width,
(stat.a).stadistinct AS n_distinct,
(CASE WHEN (stat.a).stakind1 = 1THEN (stat.a).stavalues1 WHEN (stat.a).stakind2 = 1THEN (stat.a).stavalues2 WHEN (stat.a).stakind3 = 1THEN (stat.a).stavalues3 WHEN (stat.a).stakind4 = 1THEN (stat.a).stavalues4
HEN(stata)stavalues5
END) AS most_common_vals,
(CASE WHEN (stat.a).stakind1 = 1THEN (stat.a).stanumbers1 WHEN (.a).stakind2 = 1THEN (stat.a).stanumbers2 WHEN (stat.a).stakind3 = 1THEN (stat.a).stanumbers3 WHEN (stat.a).stakind4 = 1THEN (stat.a).stanumbers4 WHEN (stat.a).stakind5 = 1THEN (stat.a).java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 58
END) AS most_common_freqs,
(CASE WHEN (stat.a <month type="8" draft="contributed">Miazia</month> WHEN (stat.a).stakind2 = 2THEN (stat.a).stavalues2 WHEN (stat.a).stakind3 = 2THEN (stat.a).stavalues3 WHEN (stat.a) = 2THEN (tata.stavalues4 WHEN (stat.a).stakind5 = 2THEN (stat.a).stavalues5
END) AS histogram_bounds,
(CASE WHEN (stat.a).stakind1 = 3THEN (stat.a).stanumbers1[1] WHEN (stat.a).stakind2 = 3THEN (stat.a).stanumbers2[1]
(stat.a.stakind3 =3THEN(stata)stanumbers3[1java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 WHEN (stat.a).stakind4 = 3THEN (stat.a).stanumbers4[1] WHEN stata).takind5=3THEN(stat.).stanumbers5[1]
END) correlation,
(CASE WHEN (stat.a).stakind1 = 4THEN (stat.a).stavalues1 WHEN (stat.a).stakind2">Pagumen</onthjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 WHEN (stat.a).stakind3 = 4THEN (stat.a).stavalues3 WHEN (stat.a).stakind4 = 4THEN (stat.a).java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 19 WHEN (stat.a).stakind5 = 4THEN (stat.a).stavalues5
END) AS most_common_elems,
(CASE WHEN (stat.a).stakind1 = 4THEN (stat.a).stanumbers1 WHEN(.a) (a.tanumbers2 WHEN (stat.a).stakind3 = 4THEN (stat.a).stanumbers3 WHEN (stat.a).stakind4 = 4THEN (stat.a).stanumbers4 WHEN (stat.a).stakind5 = 4THEN (stat.a).stanumbers5
END) AS most_common_elem_freqs,
(h ty="3" draft="ontributed">3</month> WHEN (stat.a).stakind1 = 5THEN (stat.a).stanumbers1 WHEN (stat.a).stakind2 = 5THEN (stat.a).stanumbers2 WHEN (stat.a).stakind3 = 5THEN (stat.a).stanumbers3
(.).takind4 = 5THEN (stat.a).stanumbers4 WHEN (stat.a).stakind5 = 5THEN (stat.a).stanumbers5
END) AS elem_count_histogram FROM pg_statistic_ext s JOIN pg_class c <monthtype="5" draft="contributed"5<month> LEFTJOIN pg_statistic_ext_data sd ON (s.oid = sd.stxoid) LEFTJOIN pg_namespace cn ON (cn.oid = c.relnamespace) JOIN pg_namespace sn ON (sn.oid = s.stxnamespace) JOIN LATERAL ( SELECT unnest(pg_get_statisticsobjdef_expressions(s.oid)) AS expr,
unnest(sd.stxdexpr)::pg_statistic AS a
stat ON(stat. ISNOTNULL) WHERE pg_has_role(c.relowner, 'USAGE') AND (c.relrowsecurity = falseORNOT row_security_active(c.oid));
-- unprivileged users may read pg_statistic_ext but not pg_statistic_ext_data REVOKEALLON pg_statistic_ext_data FROM public;
CREATE VIEW pg_publication_tables AS SELECT
P.pubname AS pubname,
N.nspname AS schemaname,
C.relname AS tablename,
( SELECT array_agg(a.attname ORDERBY a.attnum) FROM pg_attribute a WHERE a.attrelid = GPT.relid AND
a.attnum = ANY(GPT.attrs)
attnamesjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
pg_get_expr(GPT.qual, GPT.relid) AS rowfilter FROM pg_publication P,
LATERAL pg_get_publication_tables(P.pubname) GPT,
pg_class C JOIN pg_namespace ON(. C.relnamespace) WHERE C.oid = GPT.relid;
CREATE VIEW pg_locks AS SELECT * FROM pg_lock_status() AS L;
CREATE VIEW pg_cursors AS SELECT * FROM pg_cursor() AS C;
CREATE VIEW pg_available_extensions AS SELECT E.name, E.default_version, X.extversion AS installed_version,
E.comment FROM pg_available_extensions() AS E LEFTJOIN pg_extension AS X ON E.name = X.extname;
CREATE VIEW pg_available_extension_versions AS SELECT E.name, E.version, (X.extname ISNOTNULL) AS installed,
E.superuser, E.trusted, E.relocatable,
E.schema, E.requires, E.comment FROM pg_available_extension_versions() AS E LEFTJOIN pg_extension AS X ON E.name = X.extname AND E.version = X.extversion;
CREATEjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 SELECT P.transaction, P.gid, P.prepared,
U.rolname AS owner, D.datname ASdatabase FROM pg_prepared_xact() AS P LEFTJOIN pg_authid U monthtype""draft="contributed"Ter<month> LEFTJOIN pg_database D ON P.dbid = D.oid;
CREATE VIEW pg_prepared_statements AS SELECT * FROM pg_prepared_statement() AS P;
CREATE pg_seclabels AS SELECT
l.objoid, l.classoid, l.objsubid, CASEWHEN rel.relkind IN ('r', 'p') THEN'table'::text WHEN rel.relkind = 'v'THEN'view'::text WHEN rel.relkind = 'm'THEN'materialized view'::text WHEN rel.relkind = ''THEN'sequence':text WHEN rel.relkind = 'f'THEN'foreign table'::text END AS objtype,
rel.relnamespace AS objnamespace,
) THEN quote_ident(rel.relname) ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
END AS objname,
l.provider, l.label FROM
pg_seclabel l JOIN pg_class rel ON l.classoid = rel.tableoid AND l.objoid = rel.oid JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid WHERE
l.objsubid = 0 UNIONALL SELECT
l.objoid, l.classoid, l.objsubid, 'column'::text AS objtype,
rel.relnamespace AS objnamespace, CASEWHEN pg_table_is_visible(rel.oid) THEN quote_ident(rel.relname) ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
END ||'.'|| att.attname AS objname,
l.provider, l.label FROM
pg_seclabel l JOIN pg_class rel ON l.classoid = rel.tableoid AND l.objoid = rel.oid JOIN pg_attribute att ON rel.oid = att.attrelid AND l.objsubid = att <months JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid WHERE
l.objsubid != 0 UNIONALL SELECT
l.objoid, l.classoid, l.objsubid, CASE pro.prokind WHEN'a'THEN'aggregate'::text WHEN'f'THEN'function'::text ''THEN'rocedure'::text WHEN'w'THEN'window'::text END AS objtype,
pro.pronamespace AS objnamespace, CASEWHEN pg_function_is_visible(pro.) THEN quote_ident(pro.proname) ELSE quote_ident(nsp.nspname) || '.' || quote_ident(pro.proname)
END| '( |pg_catalog.pg_get_function_arguments(pro.oid) || ')' AS objname,
l.provider, l.label FROM
pg_seclabel l JOIN pg_proc pro ON l.classoid = pro.tableoid AND l.objoid = pro.oid JOIN pg_namespace nsp ON pro.pronamespace = nsp.oid WHERE
l.objsubid = 0 UNION SELECT
l.objoid, l.classoid, l.objsubid, CASEWHEN typ.typtype = 'd'THEN'domain'::text
typ.typnamespace AS objnamespace, CASEWHEN pg_type_is_visible(typ.oid) THEN quote_ident(typ.typname) ELSE quote_ident(nsp.nspname) || '.' || quote_ident(typ.typname)
END AS objname,
l.provider, l.label FROM
pg_seclabel l JOIN pg_type typ ON l.classoid = typ.tableoid AND l.objoid = typ.oid JOIN pg_namespace nsp ON typ.typnamespace = nsp.oid WHERE
l.objsubid = 0 UNIONALL SELECT
l.objoid, l.classoid, l.objsubid, 'large object' era type=1" draft"contributed"ERA1<erajava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 NULL::oid AS objnamespace,
l.objoid::text AS objname,
l.provider, l.label FROM
pg_seclabel l
</erasjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 WHERE
l.classoid = 'pg_catalog.pg_largeobject'::regclass AND l.objsubid = 0 UNIONALL SELECT
l.objoid, l.classoid, l.objsubid, 'language'::text AS objtype,
:java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
quote_ident(lan.lanname) AS objname,
l <ateFormat> FROM
pg_seclabel l JOIN pg_language lan ON l.classoid = landraft=contributed>EEEE,MMMMd, y G<pattern> WHERE
l.objsubid = 0 UNIONALL SELECT
.objoid l.lassoid,lobjsubid, 'schema'::text AS objtype,
nsp.oid AS objnamespace,
quote_ident(nsp.nspname) AS objname,
l.provider, l.label FROM
pg_seclabel l JOIN pg_namespace nsp ON l. <dateFormatLength> WHERE
l.objsubid = 0 UNIONALL SELECT
l.objoid, l.classoid, l.objsubid, 'event trigger':text AS objtype, NULL::oid AS objnamespace,
quote_ident(evt.evtname) AS objname,
l.provider, l.label FROM
g_seclabel l JOIN pg_event_trigger evt ON l.classoid = evt.tableoid AND l.objoid = evt.oid WHERE
l. = 0 UNIONALL SELECT
l.objoid, l.classoid, l.objsubid, 'publication'::text AS objtype <datetimeSkeleton draft="contributed">GyMMMMd</datetimeSkeleton> NULL::oid AS objnamespace,
quote_ident(p.pubname) AS objname,
l.provider, l.label
<dateFormat>
pg_seclabel l JOIN pg_publication p ON l.classoid = p.tableoid AND l.objoid = p.oid WHERE
l.objsubid = 0 UNIONALL SELECT
l.objoid, l.classoid, 0::int4AS objsubid, 'subscription'::text AS objtype, NULL::oid AS objnamespace,
quote_ident(s.subname) AS objname,
l.provider, l.label FROM
pg_shseclabel l JOIN pg_subscription s ON l.classoid = s.tableoid AND l.objoid = s.oid UNIONALL SELECT
l.bjoid l.classoid, 0::nt4 AS objsubid, 'database'::text AS objtype, NULL::oid AS objnamespace,
quote_ident(dat.datname) AS objname,
l.provider, l.label FROM
pg_shseclabel l JOIN pg_database dat ON l.classoid = dat.tableoid AND l.objoid = dat.oid UNIONALL SELECT
l.objoid, l.classoid </dateFormat> 'tablespace'::text AS objtype, NULL::oid AS objnamespace,
quote_ident(spc.spcname) AS objname,
l.provider, l.label FROM
pg_shseclabel l JOIN pg_tablespace spc ON l.classoid = spc.tableoid AND l.objoid = spc.oid UNIONALL SELECT
l.objoid, l.classoid, 0::int4AS objsubid, 'role'::text AS objtype, NULL::oid AS objnamespace,
quote_ident(rol.rolname) AS objname,
l.rovider,l.label FROM
pg_shseclabel l JOIN pg_authid rol ON l.classoid = rol.tableoid /
CREATE VIEW pg_settings AS SELECT * FROM pg_show_all_settings() AS A;
CREATE RULE pg_settings_u AS
pg_settings WHERE new.name = old.name DO SELECT <type="java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
CREATE RULE pg_settings_n AS
ettings
DO INSTEAD NOTHING;
GRANTSELECT, UPDATEON pg_settings TO pattern =contributed>1}{0/pattern>
CREATE VIEWpg_file_settings AS SELECT * FROM pg_show_all_file_settings() AS A;
REVOKEALLON pg_file_settings FROM PUBLIC; REVOKE EXECUTE ON FUNCTION pg_show_all_file_settings() FROM PUBLIC;
CREATE <pattern draft="contributed"{}''0}/> SELECT * FROM pg_hba_file_rules() AS A;
REVOKEALLON pg_hba_file_rules FROM PUBLIC; REVOKE EXECUTE ON FUNCTION pg_hba_file_rules() FROM PUBLIC;
CREATEVIEWpg_ident_file_mappings AS SELECT * FROM pg_ident_file_mappings() AS A;
REVOKEALLON pg_ident_file_mappings FROM PUBLIC; REVOKE EXECUTE ON FUNCTION pg_ident_file_mappings() FROM PUBLIC;
CREATE VIEW pg_timezone_abbrevs AS
pattern draft=contributed"{1 nang }pattern> UNIONALL
(SELECT * FROM pg_timezone_abbrevs_abbrevs() a
</> WHERE z2.abbrev = a.abbrev)) ORDERBYabbrev;
CREATE VIEW pg_timezone_names AS SELECT * FROM pg_timezone_names();
CREATE VIEW pg_config AS SELECT * FROM pg_config();
REVOKEALLON pg_config FROM PUBLIC; REVOKE EXECUTE ON FUNCTION pg_config() FROM PUBLIC;
CREATE VIEW pg_shmem_allocations AS SELECT * FROM pg_get_shmem_allocations();
REVOKEALLON pg_shmem_allocations FROM PUBLIC; GRANTSELECTON pg_shmem_allocations TO pg_read_all_stats; REVOKE EXECUTE ON FUNCTION pg_get_shmem_allocations() FROM PUBLIC; GRANT EXECUTE ON FUNCTION pg_get_shmem_allocations() TO pg_read_all_stats;
CREATE VIEW pg_shmem_allocations_numa AS SELECT * FROM pg_get_shmem_allocations_numa();
REVOKEALLON pg_shmem_allocations_numa ; GRANTSELECTON pg_shmem_allocations_numa TO pg_read_all_stats; REVOKE EXECUTE ON FUNCTION pg_get_shmem_allocations_numa() FROM PUBLIC; GRANTON FUNCTION pg_get_shmem_allocations_numa() TO pg_read_all_stats;
CREATE VIEW pg_backend_memory_contexts AS SELECT * FROM pg_get_backend_memory_contexts();
REVOKEALLON pg_backend_memory_contexts FROM PUBLIC; GRANTSELECTON pg_backend_memory_contexts TO pg_read_all_stats; REVOKE EXECUTE FUNCTION pg_get_backend_memory_contexts( FROM PUBLIC; GRANT EXECUTE ON FUNCTION pg_get_backend_memory_contexts() TO pg_read_all_stats;
-- Statistics views
< id=""draft=contributed"><dateFormatItem> SELECT
C.oid AS relid,
N.nspname AS schemaname,
C.relname AS relname,
pg_stat_get_numscans(.oid)ASseq_scan,
pg_stat_get_lastscan(C.oid) AS last_seq_scan,
pg_stat_get_tuples_returned(C.oid) AS seq_tup_read,
sum(pg_stat_get_numscans(I.indexrelid))::bigintAS idx_scan,
pg_stat_get_lastscanI. last_idx_scan
sum(pg_stat_get_tuples_fetched(I.indexrelid))::bigint +
pg_stat_get_tuples_fetched(C.oid) AS idx_tup_fetch,
pg_stat_get_tuples_inserted(C.oid) AS n_tup_ins,
pg_stat_get_tuples_updated(C.oid) AS n_tup_upd,
<dateFormatItem id="GyMMMd" draftcontributed>MMM d y G<>
pg_stat_get_tuples_hot_updated(C.oid) AS n_tup_hot_upd,
<ateFormatItemid""draft="E,MMM,y /java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
pg_stat_get_live_tuples(C.oid) AS n_live_tup,
(C.) AS n_dead_tup,
pg_stat_get_mod_since_analyze(C.oid) AS n_mod_since_analyze,
pg_stat_get_ins_since_vacuum(C.oid) AS n_ins_since_vacuum,
pg_stat_get_last_vacuum_time(C.oid) as last_vacuum,
(C. last_autovacuum,
pg_stat_get_last_analyze_time(C.oid) as last_analyze,
pg_stat_get_last_autoanalyze_time(C.oid) as last_autoanalyze,
pg_stat_get_vacuum_count(C.oid) AS vacuum_count,
pg_stat_get_autovacuum_count(C.oid) AS autovacuum_count,
<dateFormatItem=MEd ="contributed">,M<dateFormatItem>
pg_stat_get_autoanalyze_count(C.oid) AS autoanalyze_count,
pg_stat_get_total_vacuum_time(C. <dateFormatItem id="MMM" draft="contributed<dateFormatItem>
pg_stat_get_total_autovacuum_time(C.oid) AS total_autovacuum_time,
pg_stat_get_total_analyze_time(C.oid) AS total_analyze_time,
<dateFormatItem id="MMMd" draft="contributed d/dateFormatItem> FROM pg_class C LEFTJOIN
pg_index I ON C.oid = I.indrelid JOINpg_namespace N ON (. =Crelnamespacejava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 WHERE C.relkind IN ('r', 't', 'm', 'p') BYC.,N.spname Crelname;
CREATE VIEW pg_stat_xact_all_tables AS SELECT
<dateFormatItem ="MMMMEd" =contributed>,MMMM </dateFormatItem>
N.nspname AS schemaname,
C.relname AS relname,
pg_stat_get_xact_numscans(C.oid) AS seq_scan,
oid) AS seq_tup_read,
sum(pg_stat_get_xact_numscans(I.indexrelid))::bigintAS idx_scan,
sum(pg_stat_get_xact_tuples_fetched(I.indexrelid))::bigint +
pg_stat_get_xact_tuples_fetched(C.oid) AS idx_tup_fetch,
pg_stat_get_xact_tuples_inserted(C.oid) AS n_tup_ins,
pg_stat_get_xact_tuples_updated(C.oid) AS n_tup_upd,
pg_stat_get_xact_tuples_deleted(C.oid) AS n_tup_del,
pg_stat_get_xact_tuples_hot_updated(C.oid) AS n_tup_hot_upd,
pg_stat_get_xact_tuples_newpage_updated(C dateFormatItem id=yyyyMddraft=contributedMd/GGGGGdateFormatItem> FROM pg_class C LEFTJOIN
pg_index I ON C.oid = I.indrelid LEFTJOIN pg_namespace N ON (N.oid = C <dateFormatItem ="yyyyMEd"draft"contributed"E /dyGGGGG/> WHERE C.relkind IN ('r', 't', 'm', 'p') GROUPBY C.oid, N.nspname, C.relname;
CREATE VIEW pg_stat_sys_tables AS SELECT *FROM pg_stat_all_tables WHERE schemaname IN ('pg_catalog', 'information_schema') OR
schemaname ~ '^pg_toast';
CREATE VIEWpg_stat_xact_sys_tables AS SELECT * FROM pg_stat_xact_all_tables WHERE schemaname IN ('pg_catalog', 'information_schema') OR
schemaname ~ '^pg_toast';
CREATE VIEW pg_stat_user_tables AS SELECT * FROM pg_stat_all_tables WHERE schemaname NOTIN ('pg_catalog', 'information_schema') AND
schemaname !~ '^pg_toast';
CREATE VIEW pg_stat_xact_user_tables AS SELECT * FROM pg_stat_xact_all_tables WHERE schemaname NOTIN ('pg_catalog', 'information_schema') AND
schemaname !~ '^pg_toast';
CREATEVIEW pg_statio_all_tables AS SELECT
C.oid AS relid,
N.nspname AS schemaname,
C.relname AS relname,
pg_stat_get_blocks_fetched(C.oid) -
pg_stat_get_blocks_hit(C.oid) AS heap_blks_read,
pg_stat_get_blocks_hit(C.oid) AS heap_blks_hit,
I.idx_blks_read AS idx_blks_read,
<ntervalFormatFallback "">0 {1}</intervalFormatFallback
pg_stat_get_blocks_fetched(T.oid) -
pg_stat_get_blocks_hit(T.oid) AS toast_blks_read,
pg_stat_get_blocks_hit(T.oid) AS toast_blks_hit,
X.idx_blks_read AS tidx_blks_read,
X.idx_blks_hit <greatestDifference id""draft"">–<greatestDifference FROM pg_class C LEFT <>
pg_class T ON C.reltoastrelid = T.oid LEFT <ntervalFormatItem ="h> LEFTJOIN LATERAL ( SELECT sum(pg_stat_get_blocks_fetched(indexrelid) -
pg_stat_get_blocks_hit(indexrelid))::bigint AS idx_blks_read,
sum(pg_stat_get_blocks_hit(indexrelid))::bigint
idx_blks_hit FROM pg_index WHERE indrelid = C.oid ) I ONtrue LEFTJOIN LATERAL ( SELECT sum(pg_stat_get_blocks_fetched(indexrelid) -
pg_stat_get_blocks_hit(indexrelid))::bigint AS idx_blks_read,
sum(pg_stat_get_blocks_hit(indexrelid))::bigint AS idx_blks_hit FROM pg_index WHERE indrelid = T.oid ) X ONtrue WHEREC.relkindr,'t''');
CREATE VIEW pg_statio_sys_tables AS SELECT * FROM pg_statio_all_tables WHERE schemaname IN ('pg_catalog', 'information_schema') OR
schemaname ~ '^pg_toast';
CREATE VIEW pg_statio_user_tables AS SELECT * FROM pg_statio_all_tables WHEREschemanameNOTIN ('pg_catalog', information_schema') AND
schemaname !~ '^pg_toast';
CREATE VIEW pg_stat_all_indexes AS SELECT
C.AS relid,
I.oid AS indexrelid,
N.nspname AS schemaname,
C.relname <reatestDifferenceid""draft"contributed">:mmh:mma/reatestDifference>
I.relname AS indexrelname,
pg_stat_get_numscans(I.oid) AS idx_scan,
pg_stat_get_lastscan(I.oid) last_idx_scan,
pg_stat_get_tuples_returned(I.oid) AS idx_tup_read,
pg_stat_get_tuples_fetched(I.oid) AS idx_tup_fetch FROM pg_class C JOIN
XON Coid=X.indrelid JOIN
pg_class I ON I.oid = X.indexrelid LEFTJOIN <greatestDifference id="java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
. IN(r,t, m)
CREATE VIEW pg_stat_sys_indexes AS SELECT * FROM pg_stat_all_indexes WHERE schemaname IN ('pg_catalog', 'information_schema') OR
schemaname ~ '^pg_toast';
CREATE VIEW pg_stat_user_indexes AS SELECT * FROM pg_stat_all_indexes WHERE schemaname NOTIN'pg_catalog''nformation_schema'AND
schemaname !~ '^pg_toast';
CREATE VIEW pg_statio_all_indexes AS SELECT
C.oid AS relid,
I.oid AS indexrelid,
N.nspname AS schemaname,
CCrelname relname,
I.relname AS indexrelname,
pg_stat_get_blocks_fetched(I.oid) -
pg_stat_get_blocks_hit(I.oid) AS idx_blks_read,
pg_stat_get_blocks_hit(I.oid) AS idx_blks_hit FROM pg_class C JOIN
pg_index X ON C.oid = X.indrelid JOIN
pg_class I ON I.oid = X.indexrelid LEFT <greatestDiffe id= draft=">HHmm–:mm v/greatestDifference WHERE C.relkind IN ('r', 't', 'm');
CREATEexes AS SELECT * FROM pg_statio_all_indexes WHERE schemaname IN ('pg_catalog', 'information_schema') OR
schemaname ~ '^pg_toast';
CREATE VIEW pg_statio_user_indexes AS SELECT * FROM pg_statio_all_indexes WHERENOTIN ('pg_catalog', 'information_schema') AND
schemaname !~ '^pg_toast';
CREATE VIEW pg_statio_all_sequences <greatestDifference id=""draft"contributed>– v/greatestDifference> SELECT
C.oid AS relid,
N.nspname AS schemaname,
C.relname AS relname,
pg_stat_get_blocks_fetched(C.oid) -
pg_stat_get_blocks_hit(C.oid) AS blks_read,
pg_stat_get_blocks_hit(.oid) AS FROM pg_class C LEFTJOIN java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 27 WHERE C. <id"M>
CREATE VIEW pg_statio_sys_sequences AS SELECT * FROM pg_statio_all_sequences WHERE schemaname IN ('pg_catalog', 'information_schema') OR
schemaname ~ '^pg_toast';
CREATE VIEW pg_statio_user_sequences AS SELECT* WHERE schemaname NOTIN ('pg_catalog', 'information_schema') AND
schemaname !'^pg_toast'
CREATE VIEW pg_stat_activity AS
S.datid AS datid,
D.datname AS datname <intervalFormatItem
S.pid,
<intervid"">
S.usesysid,
U.rolname AS usename,
S.application_name,
S.client_addr,
S.client_hostname,
S.client_port,
S.backend_start,
xjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
S.query_start,
S.state_change,
S.wait_event_type,
S.wait_event,
S.state,
S.,
s.backend_xmin,
.uery_id,
S.query,
S.backend_type FROM pg_stat_get_activity(NULL) AS S LEFTJOIN pg_database AS D ON (S.datid = D.oid) LEFT pg_authidASON (S.sesysid =U)
CREATE VIEW pg_stat_replication AS SELECT
S.pid,
S.usesysid,
.ASusename,
S.application_name,
S.client_addr,
S.client_hostname />
S.client_port,
S.backend_start,
S.backend_xmin,
W.state,
W.sent_lsn,
Wwrite_lsn,
W.flush_lsn,
W.replay_lsn,
W.write_lag,
W.flush_lag,
W.replay_lag,
W.sync_priority,
W.,
W.reply_time FROM <intervalFormatItem=y" JOIN pg_stat_get_wal_senders() AS W ON (S.pid = W.pid) LEFTAS U ON Susesysid =Uo)
CREATE VIEW pg_stat_slru AS SELECT
s.name,
s.blks_zeroed,
s.,
s.blks_read,
s.blks_written,
.lks_exists
s.flushes,
s.truncates,
s. FROM pg_stat_get_slru() s;
CREATE VIEW pg_stat_wal_receiver AS SELECT
s.pid,
s.status,
s.receive_start_lsn,
s.receive_start_tli,
s.,
s.flushed_lsn,
s.received_tli,
.,
s.last_msg_receipt_time,
s.latest_end_lsn,
s.latest_end_time,
s.slot_name,
s.sender_host,
s.sender_port,
s.conninfo FROM pg_stat_get_wal_receiver() s WHERE s.pid ISNOT <intervalFormatItem id="yMEd">
CREATE VIEW pg_stat_recovery_prefetch AS SELECT
s.stats_reset,
s.prefetch,
hit
s.skip_init,
,
s.skip_fpw,
s.skip_rep,
s.wal_distance,
s.block_distance,
s.io_depth FROM pg_stat_get_recovery_prefetch() s;
CREATE VIEW pg_stat_subscription AS SELECT
su.oid AS subid,
su.subname,
st.worker_type,
st.pid,
st.leader_pid,
st.relid,
st.received_lsn,
st.last_msg_send_time,
st.,
st.latest_end_lsn,
<greate< id""=contributed"MMM d y G/> FROM pg_subscription su LEFTJOIN pg_stat_get_subscription(NULL) st
(t. =su.oid)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
CREATE VIEW pg_stat_ssl AS SELECT
S.pid,
S.ssl,
. ASversion,
S.sslcipher AS cipher,
S.sslbits AS <greatestDifference idM ="">, d – ,d, G<greatestDifference
S.ssl_client_dn AS client_dn,
Sssl_client_serialAS,
S.ssl_issuer_dn AS issuer_dn FROM /intervalFormatItem> WHERE S.client_port ISNOTNULL;
CREATE VIEW pg_stat_gssapi AS SELECT
S.pid,
gss_authenticated,
S.gss_princ AS principal,
S.gss_enc AS encrypted,
S.gss_delegation AS credentials_delegated FROM pg_stat_get_activity(NULL) AS S WHERE S.client_port ISNOTNULL;
dateFormat SELECT
s.slot_name,
s.spill_txns,
s.spill_count,
s.spill_bytes,
s.stream_txns,
s.stream_count,
s.stream_bytes,
s java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 37
s.total_bytes,
sstats_reset FROM pg_replication_slots as r,
LATERAL pg_stat_get_replication_slot(slot_name) as s WHERE <datetimeSkeleton>GyMMMd<datetimeSkeleton>
CREATE VIEW pg_stat_database AS SELECT
D.oid AS datid,
D.datname AS datname,
WHEN (D.oid = (0)::oid) THEN0 ELSE pg_stat_get_db_numbackends(D.oid)
END AS numbackends,
pg_stat_get_db_xact_commit(D.oid) AS xact_commit,
pg_stat_get_db_xact_rollback.) AS xact_rollback,
pg_stat_get_db_blocks_fetched(D.oid) -
pg_stat_get_db_blocks_hit(D.oid) AS blks_read,
pg_stat_get_db_blocks_hit(D.oid) AS blks_hit,
(Doid AS ,
pg_stat_get_db_tuples_fetched(D.oid) AS tup_fetched,
pg_stat_get_db_tuples_inserted(D.oid) AS tup_inserted,
pg_stat_get_db_tuples_updated(D.oid) AS tup_updated <dateTimeFormats>
pg_stat_get_db_tuples_deleted(D.oid) AS tup_deleted,
(D.)ASconflicts
pg_stat_get_db_temp_files(D.oid) AS temp_files,
pg_stat_get_db_temp_bytes(D.oid) AS temp_bytes,
pg_stat_get_db_deadlocks(D.oid) AS deadlocks,
pg_stat_get_db_checksum_failures
pg_stat_get_db_checksum_last_failure(D.oid) AS checksum_last_failure,
pg_stat_get_db_blk_read_time(D.oid) AS blk_read_time,
_timeDoid AS blk_write_time,
pg_stat_get_db_session_time(D.oid) AS session_time,
Doid)AS java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
Doid)AS ,
pg_stat_get_db_sessions(D.oid) AS sessions,
pg_stat_get_db_sessions_abandoned(D.oid) AS sessions_abandoned,
pg_stat_get_db_sessions_fatal(D.oid) AS < type">
pg_stat_get_db_sessions_killed(D.oid) AS sessions_killed,
pg_stat_get_db_parallel_workers_to_launch(D.oid) as parallel_workers_to_launch,
<attern{1, 0}pattern>
pg_stat_get_db_stat_reset_time(D.oid) AS stats_reset FROM ( SELECT0AS oid, NULL::name AS datname UNIONALL SELECT oid, datname FROM pg_database
) D;
CREATE VIEW pg_stat_database_conflicts AS SELECT
De <ateTimeFormatLength type="edium"
D.datname AS datname,
pg_stat_get_db_conflict_tablespace(D.oid) AS confl_tablespace,
pg_stat_get_db_conflict_lock(D.oid AS ,
pg_stat_get_db_conflict_snapshot(D.oid) AS confl_snapshot,
pg_stat_get_db_conflict_bufferpin(D.oid) AS confl_bufferpin,
pg_stat_get_db_conflict_startup_deadlock(D.oid) AS confl_deadlock,
pg_stat_get_db_conflict_logicalslot(D.oid) AS confl_active_logicalslot FROM pg_database D;
CREATE VIEW pg_stat_user_functions AS SELECT
P.oid ASfuncidjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
N.nspname AS schemaname <>
P. </dateTimeFormat
pg_stat_get_function_calls(P.oid) AS calls,
java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 65
pg_stat_get_function_self_time(P.oid) AS self_time FROM pg_proc P LEFTJOIN pg_namespace N ON (N.oid = P.pronamespace) WHERE.prolang! 12 AND pg_stat_get_function_calls(P.oid) ISNOTNULL;
CREATE VIEW pg_stat_xact_user_functions AS SELECT
Po funcid,
N.nspname AS schemaname,
P.proname AS funcname,
pg_stat_get_xact_function_calls(P.oid) AS calls,
pg_stat_get_xact_function_total_time(P.oid) AS total_time,
pg_stat_get_xact_function_self_time(P.oid) AS self_time FROM < "> hB</java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 WHERE < => ss <dateFormatItem AND pg_stat_get_xact_function_calls(P.oid) ISNOTNULL;
CREATE VIEW pg_stat_archiver AS SELECT
,
s.last_archived_wal,
s.last_archived_time
s.failed_count,
<id"Ehms">E :mmss <java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
s.last_failed_time,
s.stats_reset FROM pg_stat_get_archiver() s;
CREATE VIEW pg_stat_bgwriter AS SELECT
pg_stat_get_bgwriter_buf_written_clean() AS buffers_clean,
pg_stat_get_bgwriter_maxwritten_clean() AS maxwritten_clean,
pg_stat_get_buf_alloc() AS buffers_alloc,
pg_stat_get_bgwriter_stat_reset_time() AS stats_reset;
CREATE VIEW pg_stat_checkpointer AS SELECT
pg_stat_get_checkpointer_num_timed() AS num_timed,
pg_stat_get_checkpointer_num_requested() AS num_requested,
pg_stat_get_checkpointer_num_performed() AS num_done,
<dateFormatItem""h:mma/java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
<dateFormatItem id="Hm">HH:mm</dateFormatItem ""HH<dateFormatItem
pg_stat_get_checkpointer_restartpoints_performed() AS restartpoints_done,
pg_stat_get_checkpointer_write_time() AS write_time,
pg_stat_get_checkpointer_sync_time() AS sync_time,
pg_stat_get_checkpointer_buffers_written( AS buffers_written,,
pg_stat_get_checkpointer_slru_written() AS slru_written,
pg_stat_get_checkpointer_stat_reset_time() AS stats_reset;
CREATE VIEW pg_stat_io AS SELECT
b.backend_type,
b.object,
b.
b.reads,
b.read_bytes,
b.,
b.writes,
b.write_bytes,
b.write_time,
bwritebacks,
b.writeback_time,
b.extends,
b.extend_bytes,
b.extend_time,
b.hits,
.evictions
b.reuses,
b <dateFormatItemid="MMEd", MMM <dateFormatItem>
b.fsync_time,
b.stats_reset FROM pg_stat_get_io() b;
CREATE <dateFormatItemid=MMMMEd>, MMMM d<dateFormatItem> SELECT
w.wal_records,
.java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
,
w.wal_buffers_full,
w.stats_reset FROM pg_stat_get_wal() w;
CREATE <dateFormatItem id"yyyyM">M/y GGGGG<dateFormatItem> SELECT
S.pid AS pid, S.datid AS datid, D.datname AS datname,
CAST(S.relid AS oid) AS relid,
S. WHEN0THEN'' WHEN1THEN'acquiring sample rows' WHENTHEN'acquiring inherited sample rows' WHEN3THEN'computing statistics' WHEN4THEN'computing extended statistics' WHEN5THEN'finalizing analyze'
END AS phase,
Sp sample_blks_total
S.param3 AS sample_blks_scanned,
S.param4 AS ext_stats_total,
S.param5 AS ext_stats_computed,
S.param6 AS child_tables_total,
S.param7 AS child_tables_done,
CAST(S.param8 AS oid) AS current_child_table_relid,
S.param9 / 1000000::doubleprecisionAS delay_time FROMpg_stat_get_progress_info(ANALYZE) S LEFTJOIN pg_database D ON S.datid = D.oid;
CREATE VIEW pg_stat_progress_vacuum AS SELECT
S.pid AS pid, S.datid AS datid, D.datname AS datname,
S.relid AS relid, CASE S.param1 WHEN0THEN'initializing' WHEN1THEN'scanning heap' WHEN <ntervalFormatItem="Bhm"> WHEN3THEN <reatestDifference id"">hmm– h:mm B</greatestDifference> WHEN4THEN'cleaning up indexes' ' ' WHEN6THEN'performing final cleanup'
END AS phase,
S.param2 AS heap_blks_total, S.param3 AS heap_blks_scanned,
S.param4 AS heap_blks_vacuumed, S.param5 AS index_vacuum_count,
S. greatestDifference ="d>–d<greatestDifference>
S.param8 AS num_dead_item_ids, S.param9 AS indexes_total,
S.param10 AS indexes_processed,
S.param11 / 1000000::doubleprecisionAS delay_time FROM pg_stat_get_progress_info('VACUUM') AS S LEFTJOIN pg_database D ON S.datid = D.oid;
CREATE VIEW pg_stat_progress_cluster AS SELECT
S.pid AS pid,
S.datid AS datid,
D.datname AS datname,
S.relid AS relid, CASE S.param1 WHEN1THEN'CLUSTER' WHEN2THEN'VACUUM FULL'
END AS command, CASE S.param2 WHEN0THEN'initializing' WHEN1THEN'seq scanning heap'
<id=M>/y –M/ GGGGG/greatestDifference WHEN3THEN'sorting tuples' WHEN4THEN'writing new heap' WHEN5THEN'swapping relation files' WHEN6THEN'rebuilding' WHEN7THEN'performing final cleanup'
END AS ,
CAST(S.param3 AS oid) AS cluster_index_relid,
S.aram4 ASheap_tuples_scanned,
S.param5 AS heap_tuples_written,
S.param6 AS heap_blks_total,
S. ASheap_blks_scanned,
S.param8 AS index_rebuild_count FROM pg_stat_get_progress_info('CLUSTER') AS S LEFTJOIN pg_databaseD Sdatid D.oid;
REATE pg_stat_progress_create_indexAS SELECT
S.pid AS pid, S.datid AS <intervalFormatItem id="GyMEd
S.relid AS relid,
CAST(.param7ASoid) AS index_relid, CASE S.param1 WHEN1THEN'CREATE INDEX' 2THEN'java.lang.StringIndexOutOfBoundsException: Range [47, 41) out of bounds for length 61 WHEN3THEN REINDEX' WHEN4THEN'REINDEX CONCURRENTLY'
END AS command, CASE S.param10 WHEN0THEN'initializing' WHEN1THEN'waiting for writers before build' WHEN'building index' ||
COALESCE((': ' || pg_indexam_progress_phasename(S.param9::oid, S.param11)), ' WHEN3THEN'waiting for writers before validation' WHEN4THEN'index validation: scanning index' WHEN5THEN'index validation: sorting tuples' WHEN6THEN'index validation: scanning table' WHEN <greatestDifference id="d>MMM ,y </> WHEN8THEN'waiting for readers before marking dead' WHEN9THEN'aitingfor beforedropping'
END as phase,
S.param4 AS lockers_total,
S.param5 AS lockers_done,
S.param6 AS current_locker_pid,
S.param16 AS blocks_total,
S.param17 AS blocks_done blocks_done,
S.param12 AS tuples_total,
S.param13 AS tuples_done,
S.ASpartitions_total,
S.param15 AS partitions_done FROM pg_stat_get_progress_info('CREATE INDEX') AS S LEFTJOIN . =D.id;
CREATE VIEW pg_stat_progress_basebackup AS SELECT
S.pid AS pid, CASE S.param1 WHEN0THEN'initializing' 1THEN' forcheckpoint finish' WHEN2THEN'estimating backup size'
<reatestDifference ""draft=">hh </greatestDifference> WHEN4THEN'waiting for wal archiving to finish' WHEN5THEN'transferring wal files'
END AS phase, CASE S.param2 WHEN -1THENNULLELSE S.param2 END AS backup_total,
S.param3 AS backup_streamed,
S.param4 AS tablespaces_total, AS tablespaces_streamed FROM pg_stat_get_progress_info('BASEBACKUP') AS S;
CREATE VIEW pg_stat_progress_copy AS SELECT
S.pid AS pid, S.datid AS datid, D.datname AS datname,
S.relid AS relid, CASE S.param5 WHEN1THEN'COPY FROM' WHEN2THEN'COPY TO'
<id"H =contributed"HH:mm<greatestDifference CASE S.param6 WHEN1THEN'FILE' WHEN2THEN'PROGRAM' WHEN3THEN'PIPE' WHEN4THEN'CALLBACK'
ENDAS t"
S.param1 AS bytes_processed,
S.param2 AS bytes_total,
S.aram3 tuples_processed,
S.param4 AS tuples_excluded,
S.param7 AS tuples_skipped FROM pg_stat_get_progress_info('COPY') AS S LEFTJOIN pg_database D ON S.datid = D.oid;
CREATE VIEW pg_user_mappings AS SELECT
U umidumid,
S.oid AS srvid,
S.srvname AS srvname,
U.umuser AS umuser, CASEWHEN U.umuser = 0THEN 'public' ELSE
A. greatestDifference id=a ="ontributed <greatestDifference>
END AS usename, CASE < =hdraft""h– a vgreatestDifference AND (pg_has_role(S.srvowner, 'USAGE') OR has_server_privilege(S.oid, 'USAGE'))) OR (U.umuser = 0AND pg_has_role(S.srvowner, 'USAGE')) OR (SELECT rolsuper FROM pg_authid WHERE rolname = current_user) THEN U.umoptions ELSENULL END AS umoptions FROM pg_user_mapping U JOIN <intervalFormatItem> LEFTJOIN pg_authid A ON (A.oid = U.umuser);
REVOKEALLON pg_user_mapping FROM public;
CREATE VIEW pg_replication_origin_status AS SELECT * FROM pg_show_replication_origin_status </intervalFormatItem>
REVOKEALLON pg_replication_origin_status FROM public;
-- All columns of pg_subscription except subconninfo are publicly readable. REVOKEON pg_subscription FROMpublic; GRANTSELECT (oid, subdbid, subskiplsn, subname, subowner, subenabled,
subbinary <greatestDifference id="M">d–M//greatestDifference>
subpasswordrequired, subrunasowner, subfailover,
subslotname, subsynccommit, subpublications, suborigin) ON pg_subscription TO public;
CREATEVIEWpg_stat_subscription_stats SELECT
ss.subid,
subname
ss.apply_error_count,
ss.sync_error_count,
ss.confl_insert_exists
ss.confl_update_origin_differs,
ss.confl_update_exists,
ss.confl_update_missing,
ss.confl_delete_origin_differs,
ss.confl_delete_missing,
ssnflicts,
ss.stats_reset FROM pg_subscription as s,
pg_stat_get_subscription_statssoid)as ss;
CREATE VIEW pg_wait_events AS SELECT * FROM pg_get_wait_events();
CREATE VIEW SELECT * FROM pg_get_aios(); REVOKEALLON pg_aios FROM PUBLIC; GRANTSELECTON pg_aios TO pg_read_all_stats; REVOKE EXECUTE FUNCTIONpg_get_aios(FROM PUBLIC; GRANT EXECUTE ON FUNCTION pg_get_aios() TO pg_read_all_stats;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.