Commit cd108710 authored by Michał 'czesiek' Czyżewski's avatar Michał 'czesiek' Czyżewski
Browse files

Add support for large object permissions in Postgres

parent 5edd20e1
...@@ -380,6 +380,11 @@ function create_readonly_postgres_user() { ...@@ -380,6 +380,11 @@ function create_readonly_postgres_user() {
GRANT SELECT ON ALL SEQUENCES IN SCHEMA $SCHEMA TO $RUSER_NAME; GRANT SELECT ON ALL SEQUENCES IN SCHEMA $SCHEMA TO $RUSER_NAME;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA $SCHEMA TO $RUSER_NAME;" "$DATABASE" \ GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA $SCHEMA TO $RUSER_NAME;" "$DATABASE" \
|| { display_error "Error granting USAGE on schema $SCHEMA"; return 8; } || { display_error "Error granting USAGE on schema $SCHEMA"; return 8; }
# grant SELECT on all large objects
for LOID in $( PGPASSWORD="$PG_PASS" psql -h "$PG_HOST" -U "$PG_USER" -c "SELECT DISTINCT loid FROM pg_catalog.pg_largeobject" -Xt "$DATABASE" ); do
PGPASSWORD="$PG_PASS" psql -h "$PG_HOST" -U "$PG_USER" -c "GRANT SELECT ON LARGE OBJECT $LOID TO $RUSER_NAME" "$DATABASE" \
|| { display_error "Error granting SELECT on large objects of schema $SCHEMA"; return 9; }
done
done done
done done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment