From 9dbdc29118dad87f1a32d88d2697ca09c6d1102a Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Wed, 26 Sep 2018 10:56:25 +0200 Subject: [PATCH] filter NULL values for column value suggestions --- public/app/plugins/datasource/postgres/meta_query.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/public/app/plugins/datasource/postgres/meta_query.ts b/public/app/plugins/datasource/postgres/meta_query.ts index 7339a3e3882..fd13f3b4482 100644 --- a/public/app/plugins/datasource/postgres/meta_query.ts +++ b/public/app/plugins/datasource/postgres/meta_query.ts @@ -144,6 +144,7 @@ table_schema IN ( let query = 'SELECT DISTINCT quote_literal(' + column + ')'; query += ' FROM ' + this.target.table; query += ' WHERE $__timeFilter(' + this.target.timeColumn + ')'; + query += ' AND ' + column + ' IS NOT NULL'; query += ' ORDER BY 1 LIMIT 100'; return query; }