1) 如何升级 postgres 扩展?
2)你如何安装特定的扩展版本?
在生产中,hstore 的版本已过时。
=> select * from pg_available_extensions where name ='hstore';
name | default_version | installed_version | comment
--------+-----------------+-------------------+--------------------------------------------------
hstore | 1.3 | 1.1 | data type for storing sets of (key, value) pairs
Run Code Online (Sandbox Code Playgroud)
所有其他环境 hstore 已经是 1.3,所以我没有办法测试是否create extension hstore;是我所需要的。
我想先测试升级并通过 Docker 运行 Postgres 9.4.4
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres:9.4.4
docker run -it --rm --link some-postgres:postgres postgres:9.4.4 psql -h postgres -U postgres
Run Code Online (Sandbox Code Playgroud)
但是 hstore 1.3 是默认版本
name | default_version | installed_version | comment
--------+-----------------+-------------------+--------------------------------------------------
hstore | 1.3 | 1.3 | data type for storing sets of (key, value) pairs
Run Code Online (Sandbox Code Playgroud)
升级 postgres 扩展
ALTER EXTENSION hstore UPDATE;SELECT * FROM pg_available_extension_versions WHERE name ='hstore';ALTER EXTENSION hstore UPDATE TO '1.3';安装比默认版本旧的特定版本
wget --directory-prefix /usr/share/postgresql/9.4/extension/ \ https://raw.githubusercontent.com/postgres/postgres/REL9_2_STABLE/contrib/hstore/hstore--1.1.sqlSELECT * FROM pg_available_extension_versions WHERE name ='hstore';CREATE EXTENSION hstore WITH VERSION '1.1';| 归档时间: |
|
| 查看次数: |
4347 次 |
| 最近记录: |