<commit_before>SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog, pgis;

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
-- GRANT ALL ON SCHEMA public TO PUBLIC;	-- ??? A vérifier car issu des anciens scripts
GRANT USAGE ON SCHEMA public TO :reader;
GRANT USAGE ON SCHEMA public TO :owner;
GRANT USAGE ON SCHEMA pgis TO :reader;
GRANT USAGE ON SCHEMA pgis TO :owner;

-- FUNCTIONS
REVOKE ALL ON ALL FUNCTIONS IN SCHEMA public FROM PUBLIC;
REVOKE ALL ON ALL FUNCTIONS IN SCHEMA public FROM postgres;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO postgres;
-- GRANT ALL ON ALL FUNCTIONS TO PUBLIC;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO :owner;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA pgis TO :owner;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA pgis TO :reader;

-- TABLES
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM PUBLIC;
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM postgres;
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM :reader;
GRANT ALL ON ALL TABLES IN SCHEMA public TO postgres;
-- GRANT ALL ON ALL FUNCTIONS TO PUBLIC;
GRANT ALL ON ALL TABLES IN SCHEMA public TO :owner;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO :reader;
GRANT ALL ON ALL TABLES IN SCHEMA pgis TO :owner;
GRANT SELECT ON ALL TABLES IN SCHEMA pgis TO :reader;

-- SEQUENCES
REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM PUBLIC;
REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM postgres;
REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM :reader;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO postgres;
-- GRANT ALL ON ALL FUNCTIONS TO PUBLIC;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO :owner;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO :reader;

-- ALTER DEFAULT PRIVILEGES allows you to set the privileges that will be applied to objects created in the future.
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES  FROM PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES  FROM postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES  TO postgres;
-- ALTER DEFAULT PRIVILEGES FOR ROLE postgres GRANT ALL ON FUNCTIONS  TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES  TO :owner;

ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON SEQUENCES  FROM PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON SEQUENCES  FROM postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES  TO postgres;
-- ALTER DEFAULT PRIVILEGES FOR ROLE postgres GRANT ALL ON FUNCTIONS  TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES  TO :owner;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON SEQUENCES  TO :reader;

ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON FUNCTIONS  FROM PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON FUNCTIONS  FROM postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS  TO postgres;
-- ALTER DEFAULT PRIVILEGES FOR ROLE postgres GRANT ALL ON FUNCTIONS  TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS  TO :owner;
ALTER DEFAULT PRIVILEGES IN SCHEMA pgis GRANT ALL ON FUNCTIONS  TO :owner;
ALTER DEFAULT PRIVILEGES IN SCHEMA pgis GRANT ALL ON FUNCTIONS  TO :reader;

-- mise en commentaire des restrictions de droits sur calendar_element pour les procédures stockées
-- REVOKE INSERT ON calendar_element FROM :owner;
-- REVOKE DELETE ON calendar_element FROM :owner;
-- REVOKE UPDATE ON calendar_element FROM :owner;

GRANT EXECUTE ON FUNCTION getcalendarbitmask(int, date, date) TO :reader;
GRANT EXECUTE ON FUNCTION getcalendarelementbitmask(date, date, integer, integer, date, date, integer) TO :reader;
GRANT EXECUTE ON FUNCTION applybitmask(bit varying, bit varying, date, date, calendar_operator) TO :reader;<commit_msg>Ajout d'un GRANT pour endiv_reader<commit_after>SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog, pgis;

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
-- GRANT ALL ON SCHEMA public TO PUBLIC;	-- ??? A vérifier car issu des anciens scripts
GRANT USAGE ON SCHEMA public TO :reader;
GRANT USAGE ON SCHEMA public TO :owner;
GRANT USAGE ON SCHEMA pgis TO :reader;
GRANT USAGE ON SCHEMA pgis TO :owner;

-- FUNCTIONS
REVOKE ALL ON ALL FUNCTIONS IN SCHEMA public FROM PUBLIC;
REVOKE ALL ON ALL FUNCTIONS IN SCHEMA public FROM postgres;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO postgres;
-- GRANT ALL ON ALL FUNCTIONS TO PUBLIC;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO :owner;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA pgis TO :owner;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA pgis TO :reader;

-- TABLES
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM PUBLIC;
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM postgres;
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM :reader;
GRANT ALL ON ALL TABLES IN SCHEMA public TO postgres;
-- GRANT ALL ON ALL FUNCTIONS TO PUBLIC;
GRANT ALL ON ALL TABLES IN SCHEMA public TO :owner;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO :reader;
GRANT ALL ON ALL TABLES IN SCHEMA pgis TO :owner;
GRANT SELECT ON ALL TABLES IN SCHEMA pgis TO :reader;

-- SEQUENCES
REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM PUBLIC;
REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM postgres;
REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM :reader;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO postgres;
-- GRANT ALL ON ALL FUNCTIONS TO PUBLIC;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO :owner;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO :reader;

-- ALTER DEFAULT PRIVILEGES allows you to set the privileges that will be applied to objects created in the future.
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES  FROM PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES  FROM postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES  TO postgres;
-- ALTER DEFAULT PRIVILEGES FOR ROLE postgres GRANT ALL ON FUNCTIONS  TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES  TO :owner;

ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON SEQUENCES  FROM PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON SEQUENCES  FROM postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES  TO postgres;
-- ALTER DEFAULT PRIVILEGES FOR ROLE postgres GRANT ALL ON FUNCTIONS  TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES  TO :owner;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON SEQUENCES  TO :reader;

ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON FUNCTIONS  FROM PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON FUNCTIONS  FROM postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS  TO postgres;
-- ALTER DEFAULT PRIVILEGES FOR ROLE postgres GRANT ALL ON FUNCTIONS  TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS  TO :owner;
ALTER DEFAULT PRIVILEGES IN SCHEMA pgis GRANT ALL ON FUNCTIONS  TO :owner;
ALTER DEFAULT PRIVILEGES IN SCHEMA pgis GRANT ALL ON FUNCTIONS  TO :reader;

-- mise en commentaire des restrictions de droits sur calendar_element pour les procédures stockées
-- REVOKE INSERT ON calendar_element FROM :owner;
-- REVOKE DELETE ON calendar_element FROM :owner;
-- REVOKE UPDATE ON calendar_element FROM :owner;

GRANT EXECUTE ON FUNCTION getcalendarbitmask(int, date, date) TO :reader;
GRANT EXECUTE ON FUNCTION getcalendarelementbitmask(date, date, integer, integer, date, date, integer) TO :reader;
GRANT EXECUTE ON FUNCTION applybitmask(bit varying, bit varying, date, date, calendar_operator) TO :reader;
GRANT EXECUTE ON FUNCTION getbitmaskbeetweencalendars ( integer, integer, date, date, calendar_operator) TO :reader;
{'fraction_non_alphanumeric': 0.0394704281118535, 'fraction_numerical': 0.0004949269982677555, 'mean_word_length': 4.781831187410587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1108994', 'n_tokens_mistral': 2795, 'n_tokens_neox': 2549, 'n_words': 1231}