gpt4 book ai didi

postgresql - 成为数据库 super 用户 - Engineyard

转载 作者:行者123 更新时间:2023-11-29 12:33:47 27 4
gpt4 key购买 nike

我正在尝试向我的应用程序之一添加数据库扩展,特别是 fuzzystrmatch 扩展。每当我尝试添加它时,我都会收到以下错误

-- execute("CREATE EXTENSION fuzzystrmatch") rake aborted! An error has occurred, this and all later migrations canceled:

PGError: ERROR: permission denied to create extension "fuzzystrmatch" HINT: Must be superuser to create this extension. : CREATE EXTENSION fuzzystrmatch

关于成为 super 用户,我唯一发现的是:

https://blog.engineyard.com/2012/postgresql-9-1-is-now-in-beta `

不知道怎么办?我是否 ssh 进入数据库然后必须 sudo 执行命令?我发现的一切都非常无益。感谢您的帮助。

最佳答案

免责声明:我是 Engine Yard 的 DBA 之一。

在 Engine Yard 上,您的应用程序的数据库用户帐户不是 super 用户。但是,您确实有权访问 super 用户帐户 - 只需使用“postgres”用户即可。显然,您只想将其用于管理任务,而不是在您的应用程序中!

也就是说,Engine Yard 已经提供了一种方法来为 Postgres 启用此扩展和其他扩展,如您链接的博文末尾所述。您可以使用 Chef 食谱自定义您的环境,我们提供食谱以在我们的自定义 Chef 存储库中启用 postgres 扩展,位于: https://github.com/engineyard/ey-cloud-recipes/tree/master/cookbooks/postgresql9_extensions

如果您已经在您的环境中使用自定义厨师食谱,那么设置应该很简单 - 如果没有,我建议您从此处的文档开始: https://support.cloud.engineyard.com/entries/21009867-Customize-Your-Environment-with-Chef-Recipes

如果您遇到任何问题,请提交工单,我们很乐意为您提供帮助!

关于postgresql - 成为数据库 super 用户 - Engineyard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15398714/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com