N
Neon14mo ago
wise-white

hiya, is there a way to change the owner

hiya, is there a way to change the owner of a database to a different role? trying to run any postgres sql command gives me a permission denied error
7 Replies
xenial-black
xenial-black14mo ago
the roles are in the same project
alter database redirects owner to neondb_owner;
alter database redirects owner to neondb_owner;
ambitious-aqua
ambitious-aqua14mo ago
Hey! Do you mind sharing the error you're seeing?
xenial-black
xenial-black14mo ago
ERROR: must be able to SET ROLE "neondb_owner" (SQLSTATE 42501)
ERROR: must be able to SET ROLE "neondb_owner" (SQLSTATE 42501)
i am using the correct db with the sql editor or cli
unwilling-turquoise
unwilling-turquoise14mo ago
Neon
Update a database
Updates the specified database in the branch. You can obtain a project_id by listing the projects for your Neon account. You can obtain the branch_id and database_name by listing the branch's databases. For related information, see Manage databases .
xenial-black
xenial-black14mo ago
ah, gotcha. is there no way to do it in the ui right now?
unwilling-turquoise
unwilling-turquoise14mo ago
no, nothing in the ui right now. there was an option for this at one point but it was removed and hasn't returned
xenial-black
xenial-black14mo ago
it looks like there is a bug with that endpoint?
<Response [409]>
{
"code": "",
"message": "database already exists; db_name:\"redirects\""
}
<Response [409]>
{
"code": "",
"message": "database already exists; db_name:\"redirects\""
}
oh, nvm, the body param should be empty for the "name"

Did you find this page helpful?