Home > Blockchain >  Delete all/Erase all/Reset timescaledb
Delete all/Erase all/Reset timescaledb

Time:10-22

Is there a way to reset everything in timescaledb by running a query?

I've tried DROP OWNED BY CURRENT_USER; which throws

cannot drop objects owned by role postgres because they are required by the database system

CodePudding user response:

There is no way to do that with a single query, but you can do it with two statements per database. Connect to database template1 as owner of database xy and run

DROP DATABASE xy FORCE;
CREATE DATABASE xy;

Repeat for all databases.

  • Related