在Ubuntu上更新TimescaleDB后的Postgres错误:找不到文件 [英] Postgres error after updating TimescaleDB on Ubuntu: file not found

查看:371
本文介绍了在Ubuntu上更新TimescaleDB后的Postgres错误:找不到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照官方文档我将Timescale PPA存储库添加到了apt.然后,我通过sudo apt install timescaledb-postgresql-9.6安装了它.一切都很好.

As specified in the official docs I added the Timescale PPA repository to apt. I then installed it via sudo apt install timescaledb-postgresql-9.6. All was working fine.

在最近运行的sudo apt upgrade中,时间刻度包已从 0.8.0〜ubuntu16.04 更新为 0.9.1〜ubuntu16.04 .

With a recent run of sudo apt upgrade the timescale package got updated from 0.8.0~ubuntu16.04 to 0.9.1~ubuntu16.04.

运行我的Python脚本以插入一些新数据时,我现在收到以下错误(并且未插入任何内容):

When running my Python script for inserting some new data I now get the following error (and nothing is being inserted):

2018-04-12 09:42:06,279 ERROR    Postgres: could not access file "timescaledb-0.8.0": No such file or directory

似乎旧版本的共享库仍在引用中. 在哪里?

It seems like the old version of the shared library is somewhere still referenced. Where?

我已经尝试过的:

  • 更新用于在脚本中访问的 psycopg2 Python模块.
  • 我确保我的/etc/postgresql/9.6/main/postgresql.conf仍然包含shared_preload_libraries = 'timescaledb'.
  • 通过sudo service postgresql restart重新启动postgres服务.
  • 重新启动计算机.
  • 我做了sudo apt purge timescaledb-postgresql-9.6,然后重新启动,重新安装,服务重新启动.
  • 通过psql -U postgres -h localhost -W连接到 psql 时,执行\dx命令不会将timescaledb显示为已安装的扩展名;因此按照升级文档的建议执行ALTER EXTENSION timescaledb UPDATE;不成功
  • Updating the psycopg2 Python module I use for access in my script.
  • I made sure my /etc/postgresql/9.6/main/postgresql.conf still contains shared_preload_libraries = 'timescaledb'.
  • Restarting the postgres service via sudo service postgresql restart.
  • Restarting the machine.
  • I did a sudo apt purge timescaledb-postgresql-9.6 followed by reboot, reinstall, service restart.
  • When connected to psql via psql -U postgres -h localhost -W executing the \dx command does not show timescaledb as an installed extension; so executing ALTER EXTENSION timescaledb UPDATE; as proposed by the upgrade docs here is not successful

推荐答案

知道了. ALTER EXTENSION timescaledb UPDATE;已经关闭-但是必须在您连接的数据库上执行,而不是在登录psql之后立即全局执行.并且建议还传递-X参数以禁用读取启动文件(〜/.psqlrc).

Got it. ALTER EXTENSION timescaledb UPDATE; was close - but this has to be executed on a database that you are connected to, not globally right after logging on to psql. And it's recommended to also pass the -X argument to disable reading the startup file (~/.psqlrc).

  1. psql -X -U postgres -h localhost -W
  2. \c your-timescale-extended-database-name
  3. ALTER EXTENSION timescaledb UPDATE;
  4. \dx
  1. psql -X -U postgres -h localhost -W
  2. \c your-timescale-extended-database-name
  3. ALTER EXTENSION timescaledb UPDATE;
  4. \dx

输出:

                                    List of installed extensions
    Name     | Version |   Schema   |                            Description
-------------+---------+------------+-------------------------------------------------------------------
plpgsql     | 1.0     | pg_catalog | PL/pgSQL procedural language
timescaledb | 0.9.1   | public     | Enables scalable inserts and complex queries for time-series data
(2 rows)

  1. \q退出psql
  1. \q to quit psql

这篇关于在Ubuntu上更新TimescaleDB后的Postgres错误:找不到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆