-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check the objects created by the extension
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
-- | ||
-- | ||
-- | ||
-- SELECT e.extname, ne.nspname AS extschema, p.proname, np.nspname AS proschema | ||
-- FROM pg_catalog.pg_extension AS e | ||
-- INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid) | ||
-- INNER JOIN pg_catalog.pg_proc AS p ON (p.oid = d.objid) | ||
-- INNER JOIN pg_catalog.pg_namespace AS ne ON (ne.oid = e.extnamespace) | ||
-- INNER JOIN pg_catalog.pg_namespace AS np ON (np.oid = p.pronamespace) | ||
-- WHERE d.deptype = 'e' | ||
-- ORDER BY 1, 3 | ||
DEALLOCATE PREPARE ALL; | ||
SET search_path=public,pgtap; | ||
|
||
BEGIN; | ||
|
||
SELECT plan(2); | ||
|
||
PREPARE count_functions AS | ||
SELECT count(p.proname)::int | ||
FROM pg_catalog.pg_extension AS e | ||
INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid) | ||
INNER JOIN pg_catalog.pg_proc AS p ON (p.oid = d.objid) | ||
WHERE d.deptype = 'e' AND extname = 'schedoc'; | ||
|
||
|
||
SELECT results_eq( | ||
'count_functions', | ||
$$VALUES (10)$$, | ||
'We have the right number of functions'); | ||
|
||
-- | ||
-- Tables | ||
-- | ||
PREPARE count_tables AS | ||
SELECT count(e.extname) | ||
FROM pg_catalog.pg_extension AS e | ||
INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid) | ||
INNER JOIN pg_catalog.pg_class AS p ON (p.oid = d.objid) | ||
WHERE d.deptype = 'e' AND e.extname = 'schedoc' AND p.relkind='r'; | ||
|
||
SELECT results_eq( | ||
'count_tables', | ||
$$VALUES (6)$$, | ||
'We have the right number of functions'); | ||
|
||
SELECT finish(); | ||
|
||
ROLLBACK; |