Parcourir la source

quote column name in buildValueQuery

Sven Klemm il y a 7 ans
Parent
commit
b12d049f6f
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      public/app/plugins/datasource/postgres/query_builder.ts

+ 1 - 1
public/app/plugins/datasource/postgres/query_builder.ts

@@ -39,7 +39,7 @@ export class PostgresQueryBuilder {
   }
   }
 
 
   buildValueQuery(column: string) {
   buildValueQuery(column: string) {
-    var query = "SELECT DISTINCT quote_literal(" + column + ")";
+    var query = "SELECT DISTINCT quote_literal(" + this.queryModel.quoteIdentifier(column) + ")";
     query += " FROM " + this.queryModel.quoteIdentifier(this.target.schema);
     query += " FROM " + this.queryModel.quoteIdentifier(this.target.schema);
     query += "." + this.queryModel.quoteIdentifier(this.target.table);
     query += "." + this.queryModel.quoteIdentifier(this.target.table);
     query += " ORDER BY 1 LIMIT 100";
     query += " ORDER BY 1 LIMIT 100";