Bläddra i källkod

fix constraint removal

Sven Klemm 7 år sedan
förälder
incheckning
85ab1cfa8f

+ 2 - 1
public/app/plugins/datasource/postgres/postgres_query.ts

@@ -31,8 +31,9 @@ export default class PostgresQuery {
     this.updateProjection();
     this.updateProjection();
   }
   }
 
 
+  // remove identifier quoting from identifier to use in metadata queries
   unquoteIdentifier(value) {
   unquoteIdentifier(value) {
-    if (value[0] === '"') {
+    if (value[0] === '"' && value[value.length - 1] === '"') {
       return value.substring(1, value.length - 1).replace('""', '"');
       return value.substring(1, value.length - 1).replace('""', '"');
     } else {
     } else {
       return value;
       return value;

+ 2 - 0
public/app/plugins/datasource/postgres/query_ctrl.ts

@@ -273,7 +273,9 @@ export class PostgresQueryCtrl extends QueryCtrl {
         break;
         break;
       }
       }
       case 'action': {
       case 'action': {
+        // remove element
         whereParts.splice(index, 1);
         whereParts.splice(index, 1);
+        this.queryModel.updatePersistedParts();
         this.panelCtrl.refresh();
         this.panelCtrl.refresh();
         break;
         break;
       }
       }