postgresql数据库迁移timescale插件问题处理
问题说明
使用pg_dump进行数据库迁移后,开发人员表示在使用timescale的表时报错:
ERROR: invalid INSERT on the root table of hypertable "table_name"
HINT: Make sure the TimescaleDB extension has been preloaded.
而其他表使用情况正常。
故障排查
首先确认此库下安装了timesclaedb插件:
xxx=# \dx
List of installed extensions
Name | Version | Schema | Description
--------------------+---------+------------+---------------------------------------------------------------------
pg_stat_statements | 1.7 | public | track execution statistics of all SQL statements executed
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
postgis