diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/templates/column/js/column.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/templates/column/js/column.js index 23e2d25..ae174db 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/templates/column/js/column.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/templates/column/js/column.js @@ -170,7 +170,7 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { offColor: 'primary', size: 'small'}, cellHeaderClasses:'width_percent_5', visible: function(m) { - return _.isUndefined(m.top.node_info['table']); + return _.isUndefined(m.top.node_info['table'] || m.top.node_info['view'] || m.top.node_info['mview']); }, disabled: function(m){ var name = m.get('name'); @@ -256,7 +256,7 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { type: 'text', disabled: true, editable: false, cellHeaderClasses:'width_percent_30', visible: function(m) { - return _.isUndefined(m.top.node_info['table']); + return _.isUndefined(m.top.node_info['table'] || m.top.node_info['view'] || m.top.node_info['mview']); } },{ id: 'attlen', label:'{{ _('Length') }}', cell: 'string', @@ -477,6 +477,14 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { // Checks weather to enable/disable control inSchemaWithColumnCheck: function(m) { var node_info = this.node_info || m.node_info || m.top.node_info; + + // disable all fields if column is listed under view or mview + if ('view' in node_info || 'mview' in node_info) { + if (this && _.has(this, 'name') && (this.name != 'defval')) { + return true; + } + } + if(node_info && 'schema' in node_info) { // We will disable control if it's system columns