diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/templates/index_constraint/js/index_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/templates/index_constraint/js/index_constraint.js index 1e45cad..73a563b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/templates/index_constraint/js/index_constraint.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/templates/index_constraint/js/index_constraint.js @@ -227,6 +227,20 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { } } ), + keyPathAccessor: function(obj, path) { + var res = obj; + if(_.isArray(res)) { + return _.map(res, function(o) { return o['column'] + }); + } + path = path.split('.'); + for (var i = 0; i < path.length; i++) { + if (_.isNull(res)) return null; + if (_.isEmpty(path[i])) continue; + if (!_.isUndefined(res[path[i]])) res = res[path[i]]; + } + return _.isObject(res) && !_.isArray(res) ? null : res; + }, initialize: function() { // Here we will decide if we need to call URL // Or fetch the data from parent columns collection diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/properties.sql index 99727c9..2f53a2e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/properties.sql @@ -8,7 +8,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion' WHERE tgrelid=rel.oid) AS isrepl, (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount, - (SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%' AND nspname <> 'public') THEN + (SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN quote_ident(nspname)||'.'||quote_ident(c.relname) ELSE quote_ident(c.relname) END AS inherited_tables FROM pg_inherits i diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/properties.sql index 99727c9..2f53a2e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/properties.sql @@ -8,7 +8,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion' WHERE tgrelid=rel.oid) AS isrepl, (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount, - (SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%' AND nspname <> 'public') THEN + (SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN quote_ident(nspname)||'.'||quote_ident(c.relname) ELSE quote_ident(c.relname) END AS inherited_tables FROM pg_inherits i diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js index 1370698..973b60b 100644 --- a/web/pgadmin/static/js/backform.pgadmin.js +++ b/web/pgadmin/static/js/backform.pgadmin.js @@ -1790,7 +1790,11 @@ return encodeURIComponent(rawData); }, toRaw: function(formattedData, model) { - return decodeURIComponent(formattedData); + if (_.isArray(formattedData)) { + return _.map(formattedData, decodeURIComponent); + } else { + return decodeURIComponent(formattedData); + } } });