CREATE OR REPLACE FUNCTION tests.freeze_time(frozen_time timestamp with time zone)
...
-- Add test_overrides to search path if needed
IF current_setting('search_path') NOT LIKE 'test_overrides,%' THEN
-- store search path for later
PERFORM set_config('tests.original_search_path', current_setting('search_path'), true);
-- add tests schema to start of search path
PERFORM set_config('search_path', 'test_overrides,' || current_setting('tests.original_search_path') || ',pg_catalog', true);
END IF;
-- create an overwriting now function
PERFORM set_config('tests.frozen_time', frozen_time::text, true);
END
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION tests.unfreeze_time()
RETURNS void
AS $$
BEGIN
-- restore the original now function
PERFORM set_config('tests.frozen_time', null, true);
-- restore the original search path
PERFORM set_config('search_path', current_setting('tests.original_search_path'), true);
-- ^^^^^^^^ THIS LINE IS UNCONDITIONAL ^^^^^^^
END
$$ LANGUAGE plpgsql;
Copied subset from the 0.0.6 version file, marked the problematic line (at the very end)