Cannot insert into timescaledb table after migration from Signle Server to Flexible Server

Vladimir Shurakov 66 Reputation points
2025-03-17T13:52:42.17+00:00

Hi, our Azure Database for PostgreSQL single server was automatically migrated to Database for Azure Database for PostgreSQL flexible server last Saturday. Since then we can no longer insert data into timescaledb tables. The following error appears on insert: ERROR: invalid INSERT on the root table of hypertable "table_name" HINT: Make sure the TimescaleDB extension has been preloaded. SQL state: 0A000.

We have checked the flexible server's configuration and can confirm that the timescaledb extension is installed, preloaded, and enabled in the database.

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. Adithya Prasad K 1,375 Reputation points Microsoft External Staff Moderator
    2025-03-18T00:54:36.36+00:00

    Hi Vladimir Shurakov,
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
    Issue:
    our Azure Database for PostgreSQL single server was automatically migrated to Database for Azure Database for PostgreSQL flexible server last Saturday. Since then we can no longer insert data into timescaledb tables. The following error appears on insert: ERROR: invalid INSERT on the root table of hypertable "table_name" HINT: Make sure the TimescaleDB extension has been preloaded. SQL state: 0A000.

    We have checked the flexible server's configuration and can confirm that the timescaledb extension is installed, preloaded, and enabled in the database.

    Soultion:
    Alright, after having a look at the database we found out that each of the timescaledb tables was restored from a single server database with triggers ts_insert_blocker. As explained here: https://github.com/timescale/timescaledb/issues/2304 the problem is solved by removing them from the tables.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vladimir Shurakov 66 Reputation points
    2025-03-17T21:30:43.6+00:00

    Alright, after having a look at the database we found out that each of the timescaledb tables was restored from a single server database with triggers ts_insert_blocker. As explained here: https://github.com/timescale/timescaledb/issues/2304 the problem is solved by removing them from the tables, but the reason why these triggers have appeared in DB after the migration is not clear.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.