Postgres error after updating TimescaleDB on Ubuntu: file not found
Asked Answered
E

1

5

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.

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.

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?

What I already tried:

  • 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
Entrap answered 12/4, 2018 at 7:54 Comment(0)
E
17

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

Output:

                                    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 to quit psql
Entrap answered 12/4, 2018 at 9:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.