-- Setup the database environment for the test
DO $do$
BEGIN
  -- Datestyle
  EXECUTE 'ALTER DATABASE '
          || current_database()
          || ' SET datestyle TO ISO,YMD;';

  -- Locale and encoding
  EXECUTE 'ALTER DATABASE '
          || current_database()
          || ' SET client_encoding TO UTF8';

  EXECUTE 'ALTER DATABASE '
          || current_database()
          || ' SET lc_messages TO $$en_US.UTF-8$$';

  EXECUTE 'ALTER DATABASE '
          || current_database()
          || ' SET lc_numeric TO $$en_US.UTF-8$$';

  EXECUTE 'ALTER DATABASE '
          || current_database()
          || ' SET lc_time TO $$en_US.UTF-8$$';
END;
$do$;
