From 1d596aa5551bc8831c94f55877b08a99ff175b94 Mon Sep 17 00:00:00 2001 From: Patrik Helia Date: Wed, 1 Sep 2021 17:26:44 +0200 Subject: [PATCH] Fix query for validate if table is hypertable or not Signed-off-by: Patrik Helia --- internal/schemamanagement/ts/schema_explorer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/schemamanagement/ts/schema_explorer.go b/internal/schemamanagement/ts/schema_explorer.go index 6343290..0d31256 100644 --- a/internal/schemamanagement/ts/schema_explorer.go +++ b/internal/schemamanagement/ts/schema_explorer.go @@ -14,9 +14,8 @@ const ( FROM information_schema.columns WHERE table_schema = $1 AND table_name = $2;` isHypertableQueryTemplate = `SELECT EXISTS ( - SELECT 1 - FROM timescaledb_information.hypertable - WHERE table_schema = $1 AND table_name=$2)` + SELECT 1 FROM _timescaledb_catalog.hypertable + WHERE schema_name = $1 AND table_name=$2)` hypertableDimensionsQueryTemplate = `SELECT column_name, column_type FROM _timescaledb_catalog.dimension d JOIN _timescaledb_catalog.hypertable h ON d.hypertable_id = h.id