From 20574c130a3f16a06924e2b059bbd353dee55cfc Mon Sep 17 00:00:00 2001 From: Nicholas Bowman Date: Fri, 7 Jan 2022 01:32:46 -0800 Subject: [PATCH] PostgreSQL: include numeric column type in Query Builder metaquery (#43445) * Plugins: Change the PostgreSQL plugin to include more column types in Query Builder metaquery Originally, the metaquery used in the PostgreSQL plugin to populate the column dropdown menu in the Query Builder UI only included integer- and real-typed columns. This change expands the list of acceptable types for plotting to include numeric columns, boolean columns, and textual columns, as all are types that could feasibly be desired to plot in a panel. * Update types tracked in meta query builder Removed the `boolean` and `text` types, but retained addition of `numeric` type as part of time series query builder. --- public/app/plugins/datasource/postgres/meta_query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/postgres/meta_query.ts b/public/app/plugins/datasource/postgres/meta_query.ts index 5ba0154ec01..4f915ef2fef 100644 --- a/public/app/plugins/datasource/postgres/meta_query.ts +++ b/public/app/plugins/datasource/postgres/meta_query.ts @@ -127,7 +127,7 @@ table_schema IN ( break; } case 'value': { - query += " AND data_type IN ('bigint','integer','double precision','real')"; + query += " AND data_type IN ('bigint','integer','double precision','real','numeric')"; query += ' AND column_name <> ' + this.quoteIdentAsLiteral(this.target.timeColumn); break; }