/usr/share/pgmodeler/schemas/catalog/index.sch is in pgmodeler-common 0.9.1~beta-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | # Catalog queries for indexes
# CAUTION: Do not modify this file unless you know what you are doing.
# Code generation can be broken if incorrect changes are made.
%if {list} %then
[SELECT id.indexrelid AS oid, cl.relname AS name FROM pg_index AS id
LEFT JOIN pg_class AS cl ON cl.oid = id.indexrelid ]
%if {schema} %then
[ LEFT JOIN pg_class AS tb ON id.indrelid = tb.oid
LEFT JOIN pg_namespace AS ns ON ns.oid = tb.relnamespace
WHERE nspname= ] '{schema}'
%if {table} %then
[ AND ((tb.relkind = 'r' OR tb.relkind = 'm') AND tb.relname = ] '{table}' [)]
%end
%end
%if {last-sys-oid} %then
%if {schema} %then
[ AND ]
%else
[ WHERE ]
%end
[ id.indexrelid ] {oid-filter-op} $sp {last-sys-oid}
%end
%if %not {schema} %and %not {last-sys-oid} %then
[ WHERE ]
%else
[ AND ]
%end
[ (id.indisprimary IS FALSE ]
%if ({pgsql-ver} != "9.0") %then
[ AND id.indisexclusion IS FALSE ]
%end
[) AND ((SELECT count(oid) FROM pg_constraint WHERE conindid=id.indexrelid)=0) ]
%if {not-ext-object} %then
[ AND ]( {not-ext-object} )
%end
%else
%if {attribs} %then
[SELECT id.indexrelid AS oid, cl.relname AS name,
am.amname AS index_type, id.indrelid AS table,
id.indisunique AS unique_bool, ]
%if ({pgsql-ver} == "9.0") %then
[ NULL AS collations, ]
%else
[ indcollation::oid] $ob $cb [ AS collations, ]
%end
[ id.indkey::oid] $ob $cb [ AS columns,
id.indclass::oid] $ob $cb [ AS opclasses,
pg_get_expr(indexprs, indrelid) AS expressions,
pg_get_expr(indpred, indrelid, true) predicate,
ds.description AS comment
FROM pg_index AS id
LEFT JOIN pg_class AS cl ON cl.oid = id.indexrelid
LEFT JOIN pg_am AS am ON cl.relam = am.oid
LEFT JOIN pg_description ds ON ds.objoid = id.indexrelid ]
%if {schema} %then
[ LEFT JOIN pg_class AS tb ON id.indrelid = tb.oid
LEFT JOIN pg_namespace AS ns ON ns.oid = tb.relnamespace
WHERE ns.nspname= ] '{schema}'
%if {table} %then
[ AND ((tb.relkind = 'r' OR tb.relkind = 'm') AND tb.relname = ] '{table}' [)]
%end
%end
%if {last-sys-oid} %then
%if {schema} %then
[ AND ]
%else
[ WHERE ]
%end
[ id.indexrelid ] {oid-filter-op} $sp {last-sys-oid}
%end
%if {filter-oids} %then
%if {schema} %or {last-sys-oid} %then
[ AND ]
%else
[ WHERE ]
%end
[ id.indexrelid IN (] {filter-oids} )
%end
%if %not {schema} %and %not {last-sys-oid} %and %not {filter-oids} %then
[ WHERE ]
%else
[ AND ]
%end
[ (id.indisprimary IS FALSE ]
%if ({pgsql-ver} != "9.0") %then
[ AND id.indisexclusion IS FALSE ]
%end
[) AND ((SELECT count(oid) FROM pg_constraint WHERE conindid=id.indexrelid)=0) ]
%if {not-ext-object} %then
[ AND ]( {not-ext-object} )
%end
%end
%end
|