Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ FROM pg_proc AS proc
LEFT JOIN pg_description AS des ON des.objoid = proc.oid AND des.objsubid = 0
WHERE {routineWhere}
AND ns.nspname NOT IN ('pg_catalog', 'information_schema'){schemaWhere}
AND NOT EXISTS (SELECT 1 FROM pg_depend dep WHERE dep.objid = proc.oid AND dep.deptype IN ('e', 'x'))
AND NOT EXISTS (SELECT 1 FROM pg_depend dep WHERE dep.classid = 'pg_proc'::regclass AND dep.objid = proc.oid AND dep.deptype IN ('e', 'x'))
ORDER BY ns.nspname, proc.proname
""";

Expand Down Expand Up @@ -205,7 +205,7 @@ CROSS JOIN LATERAL unnest(
LEFT JOIN pg_type AS base_typ ON base_typ.oid = typ.typbasetype
WHERE {routineWhere}
AND ns.nspname NOT IN ('pg_catalog', 'information_schema'){schemaWhere}
AND NOT EXISTS (SELECT 1 FROM pg_depend dep WHERE dep.objid = proc.oid AND dep.deptype IN ('e', 'x'))
AND NOT EXISTS (SELECT 1 FROM pg_depend dep WHERE dep.classid = 'pg_proc'::regclass AND dep.objid = proc.oid AND dep.deptype IN ('e', 'x'))
AND param.parameter_mode <> 't'
ORDER BY proc.oid, param.ordinal_position
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ FROM pg_sequence AS seq
WHERE NOT EXISTS (
SELECT 1
FROM pg_depend AS dep
WHERE dep.objid = cls.oid AND dep.deptype IN ('i', 'I', 'a')
WHERE dep.classid = 'pg_class'::regclass
AND dep.objid = cls.oid
AND dep.deptype IN ('i', 'I', 'a')
){schemaWhere}
ORDER BY ns.nspname, cls.relname
""";
Expand Down
5 changes: 4 additions & 1 deletion src/SchemaSaurus.PostgreSql/PostgreSqlSchemaReader.Tables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ WHERE cls.relkind IN ('r', 'p', 'f')
AND NOT EXISTS (
SELECT 1
FROM pg_depend dep
WHERE dep.objid = cls.oid AND dep.deptype IN ('e', 'x')
WHERE dep.classid = 'pg_class'::regclass
AND dep.objid = cls.oid
AND dep.objsubid = 0
AND dep.deptype IN ('e', 'x')
)
ORDER BY ns.nspname, cls.relname
""";
Expand Down
5 changes: 4 additions & 1 deletion src/SchemaSaurus.PostgreSql/PostgreSqlSchemaReader.Views.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ WHERE cls.relkind IN ('v', 'm')
AND NOT EXISTS (
SELECT 1
FROM pg_depend dep
WHERE dep.objid = cls.oid AND dep.deptype IN ('e', 'x')
WHERE dep.classid = 'pg_class'::regclass
AND dep.objid = cls.oid
AND dep.objsubid = 0
AND dep.deptype IN ('e', 'x')
)
ORDER BY ns.nspname, cls.relname
""";
Expand Down