admin管理员组文章数量:1401499
In PostgreSQL a database can have extensions, such as pg_trgm
. Extensions have owners. When (in a Rails app) you try to load the schema, the extension has to be owned by the owner of the database.
I have one database engine with different database-owning roles, let's say role_A
and role_G
. They each own their own database, and each database inherits from template1
.
For historical reasons, template1
already has the pg_trgm
extension, and role_A
is the extension owner when seen from within template1
.
When role_G
connects and does a CREATE DATABASE
, it gets a database in which role_A
is the owner of the pg_trgm
extension.
Both databases need the extension, and both database will be dropped and recreated frequently, as Rails likes to do with test databases.
What approach will resolve this conflict? For example, can template1
be modified so that this extension is owned by a role that will resolve to the new owner of any newly-created database? something like PUBLIC
? What commands or queries or statements will accomplish this?
本文标签: PostgreSQL extension ownersStack Overflow
版权声明:本文标题:PostgreSQL extension owners? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744229374a2596253.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论