Warehouse access

To onboard to the scheduler feature, ensure users have access to all the warehouses we route to.

Granting warehouse access does not grant any data access. It only permits users to operate the warehouses they already have data access to use.

Fast grant for all warehouses

For fast onboarding, run the following query to grant OPERATE on every warehouse to the PUBLIC role:

EXECUTE IMMEDIATE $$
DECLARE
  rs RESULTSET;
BEGIN
  SHOW WAREHOUSES;
  rs := (
    SELECT "name" AS WAREHOUSE_NAME
    FROM TABLE(RESULT_SCAN(LAST_QUERY_ID(-1)))
  );

  FOR r IN rs DO
    EXECUTE IMMEDIATE
      'GRANT OPERATE ON WAREHOUSE "' || r.WAREHOUSE_NAME || '" TO ROLE PUBLIC';
  END FOR;
END;
$$;

Last updated