当前位置:网站首页>PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement
PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement
2022-07-07 06:19:00 【yang_ z_ one】
postgresql database timescaledb function time_bucket_gapfill() Report errors, solve and replace license
List of articles
- postgresql database timescaledb function time_bucket_gapfill() Report errors, solve and replace license
- Preface
- One Have a problem :
- Two terms of settlement :
- Method 1 : Change directly timescaledb.license Parameters
- Method 2 : Replace timescaledb edition ( Bring their own 'timescale' license)
- 1. download yum package
- 2. Update the local package
- 3. Back up the original data
- 4. Back up the original table structure
- 5. Kill the process connecting to the database :
- 6. Uninstall the original timescaledb
- 7. install timescaledb
- 9. Restore the previous table structure
- 10. Restore table data
- 11. The verification results
- Postscript
Preface
Recently, I used postgresql and timescaledb Of time_bucket_gapfill() function Report errors , Let replace license, I found a big circle on the Internet , Can't find , At last, the problem was solved , This article records my solutions
One Have a problem :
An error is as follows
error : function “time_bucket_gapfill” is not supported under the current “apache” license
HINT: Upgrade your license to ‘timescale’ to use this free community feature.
Two terms of settlement :
Method 1 : Change directly timescaledb.license Parameters
see timescaledb.license Parameter command :
show timescaledb.license;
Modify the order :
alter system set timescaledb.license='timescale';
It doesn't work , An error is as follows :
lter system set timescaledb.license=‘timescale’;
error : Unable to access file “$libdir/timescaledb-tsl-2.5.2”: There is no file or directory
Then I can only change my bag
Method 2 : Replace timescaledb edition ( Bring their own ’timescale’ license)
If the above situation occurs , Then we can only
1. download yum package
First download the tape from the official website 'timescale’ Version of yum package
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{
rhel})-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2. Update the local package
yum update timescaledb_14
download rpm package
yumdownloader --resolve --destdir=/u01 timescaledb-2-postgresql-14.x86_64
Download the missing dependency package
yumdownloader --resolve --destdir=/u01 timescaledb-2-loader-postgresql-14.x86_64
yumdownloader --resolve --destdir=/u01 timescaledb-tools-0.12.0-0.el7.x86_64
3. Back up the original data
because timescaledb The versions of are inconsistent , Can't be used directly pg_dump Command to back up the data of the database
Here I use the method of single table data backup :
psql --host "0.0.0.0" --port "5432" --dbname " Original database name " --username "postgres" \
-c "\COPY (SELECT * FROM Super table name { It can be followed by where With restrictions }) TO /u01/data.csv DELIMITER ',' CSV"
4. Back up the original table structure
Here you can use pg_dump Wait for the command to export the table structure sql.
5. Kill the process connecting to the database :
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
-- don't kill my own connection
pid <> pg_backend_pid()
-- don't kill the connections to other databases
AND datname = ' Original library name '
;
6. Uninstall the original timescaledb
see
rpm -qa |grep timescaledb
uninstall
yum remove timescaledb_14-2.6.0-1.rhel7.x86_64
[[email protected] tjuser]# yum remove timescaledb_14-2.6.0-1.rhel7.x86_64
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package timescaledb_14.x86_64 0:2.6.0-1.rhel7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================
Removing:
timescaledb_14 x86_64 2.6.0-1.rhel7 installed 8.5 M
Transaction Summary
=======================================================================================================================================================
Remove 1 Package
Installed size: 8.5 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : timescaledb_14-2.6.0-1.rhel7.x86_64 1/1
Verifying : timescaledb_14-2.6.0-1.rhel7.x86_64 1/1
Removed:
timescaledb_14.x86_64 0:2.6.0-1.rhel7
Complete!
7. install timescaledb
I use the latest 2.7.0 Version of timescaledb, also 2 A dependent package
7.1 Install dependency package first
yum install timescaledb-2-loader-postgresql-14-2.7.0-0.el7.x86_64.rpm
yum install timescaledb-tools-0.12.0-0.el7.x86_64.rpm
7.2 In the installation timescaledb.
yum install timescaledb-2-postgresql-14-2.7.0-0.el7.x86_64.rpm
8. Installing a plug-in
install timescaledb
CREATE EXTENSION timescaledb;Install the required plug-ins ( such as :postgis etc. )
Create extension postgis;
Create extension “uuid-ossp”;
Create extension “postgres_fdw”
9. Restore the previous table structure
I have the previous table structure sql, It's directly executed .
10. Restore table data
psql --host “10.12.105.150” --port “5432” --dbname “timescaledb” --username “postgres” -c “\COPY Schema name . Table name FROM /u01/data-target.csv CSV”
11. The verification results
11.1 see license
show timescaledb.license;
11.2 see time_bucket_gapfill() Whether the report is wrong
To this step , We have finished it all , The error reporting of this database has been solved .
Postscript
If there are any mistakes in this article , Please point out in your comment , Or contact me , I will correct it , If you find this article useful , Please do me a favor , Let more people see , thank you
author yang_z_1 csdn Blog address : https://blog.csdn.net/yang_z_1?type=blog
边栏推荐
- tkinter窗口选择pcd文件并显示点云(open3d)
- Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)
- Go语学习笔记 - gorm使用 - 原生sql、命名参数、Rows、ToSQL | Web框架Gin(九)
- From "running distractor" to data platform, Master Lu started the road of evolution
- CTFshow--常用姿势
- 生活中的开销,怎么记账合适
- Talking about reading excel with POI
- Swagger3 configuration
- [Shell]常用shell命令及测试判断语句总结
- 3531. 哈夫曼树
猜你喜欢
苹果cms V10模板/MXone Pro自适应影视电影网站模板
JMeter function assistant - random value, random string, fixed value random extraction
On the discrimination of "fake death" state of STC single chip microcomputer
[FPGA] EEPROM based on I2C
Convert numbers to string strings (to_string()) convert strings to int sharp tools stoi();
Jinfo of JVM command: view and modify JVM configuration parameters in real time
关于STC单片机“假死”状态的判别
JVM命令之 jstat:查看JVM統計信息
Jstat of JVM command: View JVM statistics
The solution of a simple algebraic problem
随机推荐
Sequential storage of stacks
Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)
高并发大流量秒杀方案思路
开发者别错过!飞桨黑客马拉松第三期链桨赛道报名开启
计算模型 FPS
Crudini 配置文件编辑工具
JVM command - jmap: export memory image file & memory usage
Deep clustering: joint optimization of depth representation learning and clustering
CTFshow--常用姿势
Detailed explanation of platform device driver architecture in driver development
360 Zhiyu released 7.0 new products to create an exclusive "unified digital workspace" for the party, government and army, and central and state-owned enterprises
Chain storage of stack
693. Travel sequencing
Rk3399 platform development series explanation (interruption) 13.10, workqueue work queue
外设驱动库开发笔记43:GPIO模拟SPI驱动
【FPGA教程案例14】基于vivado核的FIR滤波器设计与实现
C note 13
If you don't know these four caching modes, dare you say you understand caching?
MySQL performance_ Schema common performance diagnosis query
k8s运行oracle