ALTER EXTENSION

修改扩展的SQL命令

ALTER EXTENSION 是一个用于修改扩展的DDL命令,包括执行版本升级。

ALTER EXTENSIONPostgreSQL 9.1中添加。

更改历史

示例

使用ALTER EXTENSION ... UPDATE 升级扩展

repmgr=# \dx repmgr
                  List of installed extensions
  Name  | Version | Schema |            Description
--------+---------+--------+------------------------------------
 repmgr | 5.1     | repmgr | Replication manager for PostgreSQL
(1 row)

repmgr=# SELECT name, version, installed
           FROM pg_available_extension_versions
          WHERE name='repmgr'
       ORDER BY version DESC
          LIMIT 1;
  name  | version | installed
--------+---------+-----------
 repmgr | 5.2     | f
(1 row)

repmgr=# ALTER EXTENSION repmgr UPDATE;
ALTER EXTENSION

repmgr=# \dx repmgr
                  List of installed extensions
  Name  | Version | Schema |            Description
--------+---------+--------+------------------------------------
 repmgr | 5.2     | repmgr | Replication manager for PostgreSQL
(1 row)

分类

DDL扩展SQL命令

参见

CREATE EXTENSIONDROP EXTENSION扩展pg_available_extension_versions

反馈

提交任何关于“ALTER EXTENSION”的评论、建议或更正 此处