当前位置:网站首页>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
边栏推荐
- VMware安装后打开就蓝屏
- 693. Travel sequencing
- JVM command - jmap: export memory image file & memory usage
- 360织语发布7.0新品 为党政军、央国企打造专属“统一数字工作空间”
- 【SQL实战】一条SQL统计全国各地疫情分布情况
- Ideas of high concurrency and high traffic seckill scheme
- @pathvariable 和 @Requestparam的详细区别
- Jstat pour la commande JVM: voir les statistiques JVM
- [Shell]常用shell命令及测试判断语句总结
- 开发者别错过!飞桨黑客马拉松第三期链桨赛道报名开启
猜你喜欢

When we talk about immutable infrastructure, what are we talking about
![[InstallShield] Introduction](/img/df/4522d06510ff918d00659b8358368f.jpg)
[InstallShield] Introduction

Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)

基于FPGA的VGA协议实现

@Detailed differences between pathvariable and @requestparam

JVM monitoring and diagnostic tools - command line

JVM command - jmap: export memory image file & memory usage

JVM监控及诊断工具-命令行篇

关于STC单片机“假死”状态的判别

Three updates to build applications for different types of devices | 2022 i/o key review
随机推荐
Personal imitation SSM framework
How to set up in touch designer 2022 to solve the problem that leap motion is not recognized?
SAP Spartacus checkout 流程的扩展(extend)实现介绍
Database notes 04
Jcmd of JVM command: multifunctional command line
JVM命令之- jmap:导出内存映像文件&内存使用情况
Rk3399 platform development series explanation (WiFi) 5.53, hostapd (WiFi AP mode) configuration file description
如何在Touch Designer 2022版中设置解决Leap Motion不识别的问题?
Sequential storage of stacks
Go language learning notes - Gorm use - native SQL, named parameters, rows, tosql | web framework gin (IX)
【GNN】图解GNN: A gentle introduction(含视频)
CloudCompare-点对选取
Experience sharing of contribution of "management world"
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
Apple CMS V10 template /mxone Pro adaptive film and television website template
On the discrimination of "fake death" state of STC single chip microcomputer
Introduction to the extension implementation of SAP Spartacus checkout process
3428. 放苹果
cf:C. Column Swapping【排序 + 模擬】
Three updates to build applications for different types of devices | 2022 i/o key review