obs_dumpversion and associated tests

This commit is contained in:
John Krauss
2016-06-22 14:29:58 -04:00
parent 7733529ff5
commit 446bdec30d
6 changed files with 10135 additions and 8793 deletions

View File

@@ -199,3 +199,19 @@ BEGIN
RETURN result;
END;
$$ LANGUAGE plpgsql;
-- Function that returns the currently deployed obs_dump_version from the
-- remote table of the same name.
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_DumpVersion(
)
RETURNS TEXT
AS $$
DECLARE
result text;
BEGIN
EXECUTE '
SELECT MAX(dump_id) FROM observatory.obs_dump_version
' INTO result;
END;
$$ LANGUAGE plpgsql;