From c9bbdf244c1db8499d9723bc9a6c5e9e319b614d Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Mon, 13 Aug 2018 11:23:49 +0200 Subject: [PATCH] get timecolumn datatype on timecolumn change --- 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 a196859b802..578c8875b1d 100644 --- a/public/app/plugins/datasource/postgres/query_ctrl.ts +++ b/public/app/plugins/datasource/postgres/query_ctrl.ts @@ -190,6 +190,11 @@ export class PostgresQueryCtrl extends QueryCtrl { timeColumnChanged() { this.target.timeColumn = this.timeColumnSegment.value; + this.datasource.metricFindQuery(this.metaBuilder.buildDatatypeQuery(this.target.timeColumn)).then(result => { + if (result.length === 1) { + this.target.timeColumnType = result[0]; + } + }); this.panelCtrl.refresh(); }