Reputation: 1806
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)
Upvotes: 0
Views: 2660
Reputation: 1806
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:
Upvotes: 2
Reputation: 23
I'm not sure about splitting the CREATE and REPLACE permissions, but the error you're getting seems unrelated. I think your user ci
also needs USAGE permission on the schema.
GRANT USAGE ON SCHEMA schema_name TO ci
Upvotes: 1