“Erreur: autorisation refusée pour les comptes de table postgresql 13” Réponses codées

Erreur: autorisation refusée pour les comptes de table postgresql 13

su - postgres <<xEOFx
set +H

psql -c "CREATE DATABASE mydb"
psql -c "CREATE USER user01 WITH ENCRYPTED PASSWORD 'SomePassword'"

psql -c "GRANT ALL PRIVILEGES ON ALL TABLES    IN SCHEMA public to user01"
psql -c "GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public to user01"
psql -c "GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public to user01"

psql --dbname=mydb --username=postgres -f /tmp/mydb.sql
psql -c "GRANT ALL PRIVILEGES ON DATABASE mydb TO user01"

psql -c "ALTER USER postgres WITH PASSWORD 'AnotherPassword'"
exit
xEOFx
Emmanuel Mahuni

Erreur: autorisation refusée pour les comptes de table postgresql 13

CREATE OR REPLACE FUNCTION auto_grant_func()
RETURNS event_trigger AS $$
BEGIN
    grant all on all tables in schema public to <username>;
    grant all on all sequences in schema public to <username>;
    grant select on all tables in schema public to <username>;
    grant select on all sequences in schema public to <username>;
END;
$$ LANGUAGE plpgsql;

CREATE EVENT TRIGGER auto_grant_trigger
    ON ddl_command_end
    WHEN TAG IN ('CREATE TABLE', 'CREATE TABLE AS')
EXECUTE PROCEDURE auto_grant_func();
Emmanuel Mahuni

Réponses similaires à “Erreur: autorisation refusée pour les comptes de table postgresql 13”

Questions similaires à “Erreur: autorisation refusée pour les comptes de table postgresql 13”

Plus de réponses similaires à “Erreur: autorisation refusée pour les comptes de table postgresql 13” dans Sql

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code