简体   繁体   English

可以创建扩展名,但不能在PostgreSQL中更改

[英]Can create extension but can't alter in PostgreSQL

The extension was created by user deploy with: 该扩展是由用户deploy通过以下方式创建的:

CREATE EXTENSION ltree;

now I need to move extension to another schema (still as a deploy user, schema utils is owned by deploy user too). 现在我需要扩展移动到另一个模式(仍然为deploy用户,模式utils是拥有deploy用户也是如此)。 So I do: 所以我做:

ALTER EXTENSION ltree SET SCHEMA utils;

which fails with: 失败与:

ERROR: must be owner of extension ltree 错误:必须是扩展名ltree的所有者

So 2 questions: 所以有两个问题:

  1. Why does PG allow creating the extension for deploy user but not altering it by the same user? PG为什么允许为deploy用户创建扩展名,但不允许同一用户更改扩展名?
  2. How can I change the schema of the extension still being the deploy user? 如何更改仍为deploy用户的扩展架构?

Thanks. 谢谢。

The extension has to be relocatable to move to another schema. 该扩展名必须可重定位才能移动到另一个架构。

The easiest solution is probably to just drop the extension from your schema, then create it in a new schema. 最简单的解决方案可能是从架构中删除扩展,然后在新架构中创建扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM