top of page
![](https://static.wixstatic.com/media/11062b_fac51a38acf24ea2aa030216e01a0ea3f000.jpg/v1/fill/w_288,h_162,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/11062b_fac51a38acf24ea2aa030216e01a0ea3f000.jpg)
DO [ LANGUAGE lang_name ] code
Example
DO $$DECLARE r record;
BEGIN
FOR r IN SELECT table_schema, table_name FROM
information_schema.tables
WHERE table_type = 'VIEW' AND table_schema = 'public'
LOOP
EXECUTE 'GRANT ALL ON ' || quote_ident(r.table_schema) ||
'.' || quote_ident(r.table_name) || ' TO webuser';
END LOOP;
END$$;
bottom of page