I want to create a user that can only update stored procedures in redshift. The procedures are given as .sql files that start like this
CREATE OR REPLACE PROCEDURE schema_name.procedure_name
...
Hence I created the new user in psql and tried to assign the rights: GRANT CREATE OR REPLACE PROCEDURE to ci
.
But when I try to update with the new user psql -h $host -U ci -d $database -p $port -f file.sql
it fails with ERROR: permission denied for schema schema_name
. (This works with the admin user)
Synthezising from the different comments and answers:
ci
user must be owner of the function. This means the function must be deleted beforehand (and recreated by ci
afterwards)GRANT USAGE ON SCHEMA schema_name TO ci
is necessary but not sufficient.GRANT ALL ON SCHEMA schema_name TO ci;
Open questions: