From 88cd713d3a12ae217a7d267ec5a4ac6f519c18bb Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Thu, 30 Aug 2018 15:45:05 +0200 Subject: [PATCH] reset metric column when changing table --- public/app/plugins/datasource/postgres/query_ctrl.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/app/plugins/datasource/postgres/query_ctrl.ts b/public/app/plugins/datasource/postgres/query_ctrl.ts index cf6efb98351..6102b0cd562 100644 --- a/public/app/plugins/datasource/postgres/query_ctrl.ts +++ b/public/app/plugins/datasource/postgres/query_ctrl.ts @@ -205,6 +205,11 @@ export class PostgresQueryCtrl extends QueryCtrl { this.target.group = []; this.updateProjection(); + let segment = this.uiSegmentSrv.newSegment('none'); + this.metricColumnSegment.html = segment.html; + this.metricColumnSegment.value = segment.value; + this.target.metricColumn = 'none'; + let task1 = this.datasource.metricFindQuery(this.metaBuilder.buildColumnQuery('time')).then(result => { // check if time column is still valid if (result.length > 0 && !_.find(result, (r: any) => r.text === this.target.timeColumn)) {