소스 검색

fix constraint removal

Sven Klemm 7 년 전
부모
커밋
85ab1cfa8f
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      public/app/plugins/datasource/postgres/postgres_query.ts
  2. 2 0
      public/app/plugins/datasource/postgres/query_ctrl.ts

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

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

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

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