当前位置:网站首页>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
边栏推荐
猜你喜欢
JVM monitoring and diagnostic tools - command line
一名普通学生的大一总结【不知我等是愚是狂,唯知一路向前奔驰】
3531. Huffman tree
win系统下安装redis以及windows扩展方法
cf:C. Column Swapping【排序 + 模拟】
A freshman's summary of an ordinary student [I don't know whether we are stupid or crazy, but I know to run forward all the way]
Cf:c. column swapping [sort + simulate]
How to set up in touch designer 2022 to solve the problem that leap motion is not recognized?
Chain storage of stack
[FPGA tutorial case 13] design and implementation of CIC filter based on vivado core
随机推荐
Oracle迁移中关于大容量表使用数据泵(expdp、impdp)导出导入容易出现的问题和注意事项
直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级
10W word segmentation searches per second, the product manager raised another demand!!! (Collection)
You don't know the complete collection of recruitment slang of Internet companies
Jinfo of JVM command: view and modify JVM configuration parameters in real time
693. Travel sequencing
jvm命令之 jcmd:多功能命令行
Talking about reading excel with POI
可极大提升编程思想与能力的书有哪些?
The boss always asks me about my progress. Don't you trust me? (what do you think)
Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)
[SQL practice] a SQL statistics of epidemic distribution across the country
CMD permanently delete specified folders and files
Test the foundation of development, and teach you to prepare for a fully functional web platform environment
tkinter窗口选择pcd文件并显示点云(open3d)
win系统下安装redis以及windows扩展方法
牛客小白月赛52 E.分组求对数和(二分&容斥)
Peripheral driver library development notes 43: GPIO simulation SPI driver
From "running distractor" to data platform, Master Lu started the road of evolution
JVM command - jmap: export memory image file & memory usage