---------------------------------------------------------
--  Create function to test with, namely: ASSERT_MINIMUM 
---------------------------------------------------------

CREATE OR REPLACE FUNCTION assert_minimum (message VARCHAR, min_expected BIGINT, actual BIGINT) RETURNS INTEGER AS $$
   BEGIN
      IF actual < min_expected THEN
         RAISE EXCEPTION '%: Minimum expected:<%> but actual:<%>', message, min_expected, actual;
      END IF;
      RETURN NULL;
   END
$$ LANGUAGE 'plpgsql';