BEGIN;
    -- Load the TAP functions.
    CREATE EXTENSION pgtap;
    SET client_min_messages TO warning;

    -- Plan the tests.
    SELECT plan(1);

    -- Add data
    \i xt/data/42-pg/Base.sql

    -- Load the functions to check in a temporary table.
    CREATE TEMPORARY TABLE blacklisted_funcs (funcname text primary key);
    \copy blacklisted_funcs from 'sql/modules/BLACKLIST';

    -- Run tests
    PREPARE test AS SELECT count(*) = 0
                    FROM (select proname FROM pg_proc
                            WHERE pronamespace =
                                    (select oid from pg_namespace
                                      where nspname = current_schema())
                                            AND prokind NOT IN ('a', 'w')
                                            AND proname IN (select funcname FROM blacklisted_funcs)
                            group by proname
                            having count(*) > 1
                    ) t;
    SELECT results_eq('test',ARRAY[true],'No overloaded functions in current schema');
    DEALLOCATE test;

    -- Finish the tests and clean up.
    SELECT * FROM finish();

ROLLBACK;
