public inbox for [email protected]help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited 12+ messages / 2 participants [nested] [flat]
* [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-09-23 06:39 Surinder Kumar <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Surinder Kumar @ 2016-09-23 06:39 UTC (permalink / raw) To: pgadmin-hackers Hi *Issue:* on updating node, we deselect and then again select the node updated to refresh the panel. but it needs some delay of few milliseconds between deselect and select to fix this issue. Please find attached patch and review. Thanks, Surinder Kumar -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] RM1728.patch (1.2K, 3-RM1728.patch) download | inline diff: diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js index 46c49cf..3652ec5 100644 --- a/web/pgadmin/browser/templates/browser/js/browser.js +++ b/web/pgadmin/browser/templates/browser/js/browser.js @@ -1148,7 +1148,8 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) { if ( this.i && this.d && this.new._type == this.d._type ) { - var _id = this.d._id; + var self = this, + _id = this.d._id; if (this.new._id != this.d._id) { // Found the new oid, update its node_id var node_data = this.t.itemData(ctx.i); @@ -1162,7 +1163,10 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) { this.t.setId(ctx.id, {id: this.new.id}); this.t.openPath(this.i); this.t.deselect(this.i); - this.t.select(this.i); + // select tree item after few milliseconds + setTimeout(function() { + self.t.select(self.i); + }, 10); } } var success = this.o && this.o.success; ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-09-23 09:14 Dave Page <[email protected]> parent: Surinder Kumar <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Dave Page @ 2016-09-23 09:14 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Hi On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar <[email protected]> wrote: > Hi > > Issue: > on updating node, we deselect and then again select the node updated to > refresh the panel. but it needs some delay of few milliseconds between > deselect and select to fix this issue. > > Please find attached patch and review. This does not resolve the issue for me. I tested using a synonym to a package on EPAS 9.5, by changing the target package name. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-09-23 11:05 Surinder Kumar <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Surinder Kumar @ 2016-09-23 11:05 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers Hi, Please find updated patch with changes: 1) On debugging through JS files, the issue was in synonym update method which wasn't returning node object. 2) retrieving schema name in node.sql for creating node object in update method. Please review and let me know for comments. On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> wrote: > Hi > > On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar > <[email protected]> wrote: > > Hi > > > > Issue: > > on updating node, we deselect and then again select the node updated to > > refresh the panel. but it needs some delay of few milliseconds between > > deselect and select to fix this issue. > > > > Please find attached patch and review. > > This does not resolve the issue for me. I tested using a synonym to a > package on EPAS 9.5, by changing the target package name. > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] RM1728_v1.patch (4.1K, 3-RM1728_v1.patch) download | inline diff: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py index 95e58b6..2d2e40f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py @@ -483,14 +483,23 @@ class SynonymView(PGChildNodeView): if not status: return internal_server_error(errormsg=res) - return make_json_response( - success=1, - info="Synonym updated", - data={ - 'id': syid, - 'scid': scid, - 'did': did - } + SQL = render_template( + "/".join([self.template_path, 'nodes.sql']), + scid=scid + ) + + status, rset = self.conn.execute_2darray(SQL) + if not status: + return internal_server_error(errormsg=rset) + row = rset['rows'][0] + + return jsonify( + node=self.blueprint.generate_browser_node( + syid, + row['schema'], + row['name'], + icon="icon-%s" % self.node_type + ) ) else: return make_json_response( diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.1_plus/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.1_plus/nodes.sql index 1f8259b..42caf40 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.1_plus/nodes.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.1_plus/nodes.sql @@ -1,4 +1,4 @@ -SELECT synname as name +SELECT synname as name, synnamespace as schema FROM pg_synonym s JOIN pg_namespace ns ON s.synnamespace = ns.oid AND s.synnamespace = {{scid}}::oid diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/nodes.sql index 1f8259b..42caf40 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/nodes.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/nodes.sql @@ -1,4 +1,4 @@ -SELECT synname as name +SELECT synname as name, synnamespace as schema FROM pg_synonym s JOIN pg_namespace ns ON s.synnamespace = ns.oid AND s.synnamespace = {{scid}}::oid diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js index 46c49cf..3652ec5 100644 --- a/web/pgadmin/browser/templates/browser/js/browser.js +++ b/web/pgadmin/browser/templates/browser/js/browser.js @@ -1148,7 +1148,8 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) { if ( this.i && this.d && this.new._type == this.d._type ) { - var _id = this.d._id; + var self = this, + _id = this.d._id; if (this.new._id != this.d._id) { // Found the new oid, update its node_id var node_data = this.t.itemData(ctx.i); @@ -1162,7 +1163,10 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) { this.t.setId(ctx.id, {id: this.new.id}); this.t.openPath(this.i); this.t.deselect(this.i); - this.t.select(this.i); + // select tree item after few milliseconds + setTimeout(function() { + self.t.select(self.i); + }, 10); } } var success = this.o && this.o.success; ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-09-23 12:29 Dave Page <[email protected]> parent: Surinder Kumar <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Dave Page @ 2016-09-23 12:29 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Thanks, applied. On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar <[email protected]> wrote: > Hi, > > Please find updated patch with changes: > 1) On debugging through JS files, the issue was in synonym update method > which wasn't returning node object. > 2) retrieving schema name in node.sql for creating node object in update > method. > > Please review and let me know for comments. > > On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> wrote: >> >> Hi >> >> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >> <[email protected]> wrote: >> > Hi >> > >> > Issue: >> > on updating node, we deselect and then again select the node updated to >> > refresh the panel. but it needs some delay of few milliseconds between >> > deselect and select to fix this issue. >> > >> > Please find attached patch and review. >> >> This does not resolve the issue for me. I tested using a synonym to a >> package on EPAS 9.5, by changing the target package name. >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-09-23 12:30 Dave Page <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Dave Page @ 2016-09-23 12:30 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Umm, no it wasn't - sorry. I see the same issue with Types. Can you fix that, and check all other nodes as well please? Thanks. On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> wrote: > Thanks, applied. > > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar > <[email protected]> wrote: >> Hi, >> >> Please find updated patch with changes: >> 1) On debugging through JS files, the issue was in synonym update method >> which wasn't returning node object. >> 2) retrieving schema name in node.sql for creating node object in update >> method. >> >> Please review and let me know for comments. >> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> wrote: >>> >>> Hi >>> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >>> <[email protected]> wrote: >>> > Hi >>> > >>> > Issue: >>> > on updating node, we deselect and then again select the node updated to >>> > refresh the panel. but it needs some delay of few milliseconds between >>> > deselect and select to fix this issue. >>> > >>> > Please find attached patch and review. >>> >>> This does not resolve the issue for me. I tested using a synonym to a >>> package on EPAS 9.5, by changing the target package name. >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >> >> > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-14 10:01 Surinder Kumar <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Surinder Kumar @ 2016-10-14 10:01 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers Hi *Following are the issues fixed in nodes:* 1) If we create/update a node with non-default schema, It should return selected schema id in return response. but default schema id is returned every time due to which it throws error in properties panel. Fixed in Domains, Collation, Types, Views & Table node. 2) Incorrect parent id of object node is returned from *nodes method* due to which wrong parent id is passed while updating object and thus node didn't get refreshed. Fixed in FTS Configuration, FTS Parser nodes. Also, I have kept changes of first patch which are essential to refresh node every time. Without that patch nodes properties panel updates only sometimes. Please find attached patch. Please review and let me know for comments. Thanks Surinder Kumar On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected]> wrote: > Umm, no it wasn't - sorry. > > I see the same issue with Types. Can you fix that, and check all other > nodes as well please? > > Thanks. > > On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> wrote: > > Thanks, applied. > > > > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar > > <[email protected]> wrote: > >> Hi, > >> > >> Please find updated patch with changes: > >> 1) On debugging through JS files, the issue was in synonym update method > >> which wasn't returning node object. > >> 2) retrieving schema name in node.sql for creating node object in update > >> method. > >> > >> Please review and let me know for comments. > >> > >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> wrote: > >>> > >>> Hi > >>> > >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar > >>> <[email protected]> wrote: > >>> > Hi > >>> > > >>> > Issue: > >>> > on updating node, we deselect and then again select the node updated > to > >>> > refresh the panel. but it needs some delay of few milliseconds > between > >>> > deselect and select to fix this issue. > >>> > > >>> > Please find attached patch and review. > >>> > >>> This does not resolve the issue for me. I tested using a synonym to a > >>> package on EPAS 9.5, by changing the target package name. > >>> > >>> > >>> -- > >>> Dave Page > >>> Blog: http://pgsnake.blogspot.com > >>> Twitter: @pgsnake > >>> > >>> EnterpriseDB UK: http://www.enterprisedb.com > >>> The Enterprise PostgreSQL Company > >> > >> > > > > > > > > -- > > Dave Page > > Blog: http://pgsnake.blogspot.com > > Twitter: @pgsnake > > > > EnterpriseDB UK: http://www.enterprisedb.com > > The Enterprise PostgreSQL Company > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] RM1728_v2.patch (13.6K, 3-RM1728_v2.patch) download | inline diff: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py index 941604d..1e1f536 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py @@ -443,6 +443,13 @@ class CollationView(PGChildNodeView): if not status: return internal_server_error(errormsg=coid) + # Get updated schema oid + SQL = render_template("/".join([self.template_path, + 'get_oid.sql']), coid=coid) + status, scid = self.conn.execute_scalar(SQL) + if not status: + return internal_server_error(errormsg=coid) + return jsonify( node=self.blueprint.generate_browser_node( coid, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py index 59d9a3d..52b2079 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py @@ -546,6 +546,14 @@ AND relkind != 'c'))""" if not status: return internal_server_error(errormsg=res) + # Get updated schema oid + SQL = render_template("/".join([self.template_path, + 'get_oid.sql']), + doid=doid) + status, scid = self.conn.execute_scalar(SQL) + if not status: + return internal_server_error(errormsg=res) + return jsonify( node=self.blueprint.generate_browser_node( doid, @@ -640,12 +648,10 @@ AND relkind != 'c'))""" SQL = render_template("/".join([self.template_path, 'get_oid.sql']), doid=doid) - status, res = self.conn.execute_2darray(SQL) + status, scid = self.conn.execute_scalar(SQL) if not status: return internal_server_error(errormsg=res) - scid = res['rows'][0]['scid'] - return jsonify( node=self.blueprint.generate_browser_node( doid, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py index 4dc9cf2..f9fca3a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py @@ -286,7 +286,7 @@ class FtsConfigurationView(PGChildNodeView): res.append( self.blueprint.generate_browser_node( row['oid'], - did, + scid, row['name'], icon="icon-fts_configuration" )) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/__init__.py index b80f9eb..52cb2d8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/__init__.py @@ -256,7 +256,7 @@ class FtsParserView(PGChildNodeView): res.append( self.blueprint.generate_browser_node( row['oid'], - did, + scid, row['name'], icon="icon-fts_parser" )) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/get_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/get_schema.sql new file mode 100644 index 0000000..c05ee0f --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/templates/synonym/sql/9.5_plus/get_schema.sql @@ -0,0 +1,7 @@ +{# ===== fetch new assigned schema id ===== #} +SELECT + c.relnamespace as scid +FROM + pg_class c +WHERE + c.oid = {{syid|qtLiteral}}::oid; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py index 040afb8..daa6ef0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py @@ -1442,9 +1442,17 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings): if not status: return internal_server_error(errormsg=res) + # Get updated schema oid + SQL = render_template("/".join([self.template_path, + 'get_schema_oid.sql']), tname=data['name']) + + status, scid = self.conn.execute_scalar(SQL) + if not status: + return internal_server_error(errormsg=scid) + # we need oid to to add object in tree at browser SQL = render_template("/".join([self.template_path, - 'get_oid.sql']), scid=scid, data=data) + 'get_oid.sql']), scid=scid, data=data) status, tid = self.conn.execute_scalar(SQL) if not status: return internal_server_error(errormsg=tid) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/get_schema_oid.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/get_schema_oid.sql index 99498f3..4d329d2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/get_schema_oid.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/get_schema_oid.sql @@ -1,9 +1,11 @@ {# ===== fetch new assigned schema oid ===== #} -{% if tid %} SELECT c.relnamespace as scid FROM pg_class c WHERE +{% if tid %} c.oid = {{tid}}::oid; +{% else %} + c.relname = {{tname|qtLiteral}}::text; {% endif %} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/get_schema_oid.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/get_schema_oid.sql index 99498f3..4d329d2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/get_schema_oid.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/get_schema_oid.sql @@ -1,9 +1,11 @@ {# ===== fetch new assigned schema oid ===== #} -{% if tid %} SELECT c.relnamespace as scid FROM pg_class c WHERE +{% if tid %} c.oid = {{tid}}::oid; +{% else %} + c.relname = {{tname|qtLiteral}}::text; {% endif %} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py index c67c47c..e6b7f3c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py @@ -902,10 +902,17 @@ class TypeView(PGChildNodeView, DataTypeReader): try: SQL = render_template("/".join([self.template_path, 'create.sql']), data=data, conn=self.conn) - status, res = self.conn.execute_scalar(SQL) + status, res = self.conn.execute_dict(SQL) if not status: return internal_server_error(errormsg=res) + # we need scid to update in browser tree + SQL = render_template("/".join([self.template_path, + 'get_scid.sql']), tname=data['name']) + status, scid = self.conn.execute_scalar(SQL) + if not status: + return internal_server_error(errormsg=scid) + # we need oid to to add object in tree at browser SQL = render_template("/".join([self.template_path, 'get_oid.sql']), @@ -948,6 +955,14 @@ class TypeView(PGChildNodeView, DataTypeReader): if not status: return internal_server_error(errormsg=res) + SQL = render_template("/".join([self.template_path, + 'get_scid.sql']), tname=data['name']) + + # Get updated schema oid + status, scid = self.conn.execute_scalar(SQL) + if not status: + return internal_server_error(errormsg=res) + return jsonify( node=self.blueprint.generate_browser_node( tid, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_oid.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_oid.sql index 14f7950..1751498 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_oid.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_oid.sql @@ -8,4 +8,4 @@ WHERE t.typtype != 'd' AND t.typname NOT LIKE E'\\_%' AND t.typnamespace = {{sci {% if data %} AND t.typname = {{data.name|qtLiteral}} {% endif %} -ORDER BY t.typname; \ No newline at end of file +ORDER BY t.typname; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql new file mode 100644 index 0000000..696a205 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql @@ -0,0 +1,6 @@ +SELECT + t.typnamespace as scid +FROM + pg_type t +WHERE + t.typname = {{tname|qtLiteral}}::text; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py index 1063c4e..73f818f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py @@ -487,12 +487,24 @@ class ViewNode(PGChildNodeView, VacuumSettings): SQL = render_template("/".join( [self.template_path, 'sql/view_id.sql']), data=data) status, view_id = self.conn.execute_scalar(SQL) + + if not status: + return internal_server_error(errormsg=res) + + # Get updated schema oid + SQL = render_template("/".join( + [self.template_path, 'sql/get_oid.sql']), vid=view_id) + status, scid = self.conn.execute_scalar(SQL) + + if not status: + return internal_server_error(errormsg=res) + return jsonify( node=self.blueprint.generate_browser_node( view_id, scid, data['name'], - icon="icon-%s" % self.node_type + icon="icon-view" ) ) except Exception as e: @@ -525,15 +537,13 @@ class ViewNode(PGChildNodeView, VacuumSettings): view_id = res_data['rows'][0]['oid'] new_view_name = res_data['rows'][0]['relname'] + # Get updated schema oid SQL = render_template("/".join( [self.template_path, 'sql/get_oid.sql']), vid=view_id) - status, res = self.conn.execute_2darray(SQL) + status, scid = self.conn.execute_scalar(SQL) if not status: return internal_server_error(errormsg=res) - # new schema id - scid = res['rows'][0]['scid'] - return jsonify( node=self.blueprint.generate_browser_node( view_id, diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js index 46c49cf..3652ec5 100644 --- a/web/pgadmin/browser/templates/browser/js/browser.js +++ b/web/pgadmin/browser/templates/browser/js/browser.js @@ -1148,7 +1148,8 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) { if ( this.i && this.d && this.new._type == this.d._type ) { - var _id = this.d._id; + var self = this, + _id = this.d._id; if (this.new._id != this.d._id) { // Found the new oid, update its node_id var node_data = this.t.itemData(ctx.i); @@ -1162,7 +1163,10 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) { this.t.setId(ctx.id, {id: this.new.id}); this.t.openPath(this.i); this.t.deselect(this.i); - this.t.select(this.i); + // select tree item after few milliseconds + setTimeout(function() { + self.t.select(self.i); + }, 10); } } var success = this.o && this.o.success; ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-14 19:19 Dave Page <[email protected]> parent: Surinder Kumar <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Dave Page @ 2016-10-14 19:19 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Thanks, applied. On Friday, October 14, 2016, Surinder Kumar <[email protected]> wrote: > Hi > > *Following are the issues fixed in nodes:* > > 1) If we create/update a node with non-default schema, It should return > selected schema id in return response. but default schema id is returned > every time due to which it throws error in properties panel. > Fixed in Domains, Collation, Types, Views & Table node. > > 2) Incorrect parent id of object node is returned from *nodes method* due > to which wrong parent id is passed while updating object and > thus node didn't get refreshed. > Fixed in FTS Configuration, FTS Parser nodes. > > Also, I have kept changes of first patch which are essential to refresh > node every time. Without that patch nodes properties panel updates only > sometimes. > > Please find attached patch. Please review and let me know for comments. > > Thanks > Surinder Kumar > > > > On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: > >> Umm, no it wasn't - sorry. >> >> I see the same issue with Types. Can you fix that, and check all other >> nodes as well please? >> >> Thanks. >> >> On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: >> > Thanks, applied. >> > >> > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar >> > <[email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: >> >> Hi, >> >> >> >> Please find updated patch with changes: >> >> 1) On debugging through JS files, the issue was in synonym update >> method >> >> which wasn't returning node object. >> >> 2) retrieving schema name in node.sql for creating node object in >> update >> >> method. >> >> >> >> Please review and let me know for comments. >> >> >> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: >> >>> >> >>> Hi >> >>> >> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >> >>> <[email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: >> >>> > Hi >> >>> > >> >>> > Issue: >> >>> > on updating node, we deselect and then again select the node >> updated to >> >>> > refresh the panel. but it needs some delay of few milliseconds >> between >> >>> > deselect and select to fix this issue. >> >>> > >> >>> > Please find attached patch and review. >> >>> >> >>> This does not resolve the issue for me. I tested using a synonym to a >> >>> package on EPAS 9.5, by changing the target package name. >> >>> >> >>> >> >>> -- >> >>> Dave Page >> >>> Blog: http://pgsnake.blogspot.com >> >>> Twitter: @pgsnake >> >>> >> >>> EnterpriseDB UK: http://www.enterprisedb.com >> >>> The Enterprise PostgreSQL Company >> >> >> >> >> > >> > >> > >> > -- >> > Dave Page >> > Blog: http://pgsnake.blogspot.com >> > Twitter: @pgsnake >> > >> > EnterpriseDB UK: http://www.enterprisedb.com >> > The Enterprise PostgreSQL Company >> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-16 01:59 Dave Page <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Dave Page @ 2016-10-16 01:59 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Hi I just found a case where this patch is broken - if you update the comment on a type, it looks like it tried to lookup the schema ID using the type name, which a) isn't in the posted data so gives a 500 response, and b) wouldn't be safe anyway, if there were types with the same name in multiple schemas. Actually, it looks like that's an issue when creating a type too - that is also using an unsafe schema lookup. Please fix this ASAP (i.e. Monday) and double check to ensure we're not doing any more unsafe lookups like this. Thanks. On Friday, October 14, 2016, Dave Page <[email protected]> wrote: > Thanks, applied. > > On Friday, October 14, 2016, Surinder Kumar <surinder.kumar@enterprisedb. > com <javascript:_e(%7B%7D,'cvml','[email protected]');>> > wrote: > >> Hi >> >> *Following are the issues fixed in nodes:* >> >> 1) If we create/update a node with non-default schema, It should return >> selected schema id in return response. but default schema id is returned >> every time due to which it throws error in properties panel. >> Fixed in Domains, Collation, Types, Views & Table node. >> >> 2) Incorrect parent id of object node is returned from *nodes method* >> due to which wrong parent id is passed while updating object and >> thus node didn't get refreshed. >> Fixed in FTS Configuration, FTS Parser nodes. >> >> Also, I have kept changes of first patch which are essential to refresh >> node every time. Without that patch nodes properties panel updates only >> sometimes. >> >> Please find attached patch. Please review and let me know for comments. >> >> Thanks >> Surinder Kumar >> >> >> >> On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected]> wrote: >> >>> Umm, no it wasn't - sorry. >>> >>> I see the same issue with Types. Can you fix that, and check all other >>> nodes as well please? >>> >>> Thanks. >>> >>> On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> wrote: >>> > Thanks, applied. >>> > >>> > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar >>> > <[email protected]> wrote: >>> >> Hi, >>> >> >>> >> Please find updated patch with changes: >>> >> 1) On debugging through JS files, the issue was in synonym update >>> method >>> >> which wasn't returning node object. >>> >> 2) retrieving schema name in node.sql for creating node object in >>> update >>> >> method. >>> >> >>> >> Please review and let me know for comments. >>> >> >>> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> wrote: >>> >>> >>> >>> Hi >>> >>> >>> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >>> >>> <[email protected]> wrote: >>> >>> > Hi >>> >>> > >>> >>> > Issue: >>> >>> > on updating node, we deselect and then again select the node >>> updated to >>> >>> > refresh the panel. but it needs some delay of few milliseconds >>> between >>> >>> > deselect and select to fix this issue. >>> >>> > >>> >>> > Please find attached patch and review. >>> >>> >>> >>> This does not resolve the issue for me. I tested using a synonym to a >>> >>> package on EPAS 9.5, by changing the target package name. >>> >>> >>> >>> >>> >>> -- >>> >>> Dave Page >>> >>> Blog: http://pgsnake.blogspot.com >>> >>> Twitter: @pgsnake >>> >>> >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> >>> The Enterprise PostgreSQL Company >>> >> >>> >> >>> > >>> > >>> > >>> > -- >>> > Dave Page >>> > Blog: http://pgsnake.blogspot.com >>> > Twitter: @pgsnake >>> > >>> > EnterpriseDB UK: http://www.enterprisedb.com >>> > The Enterprise PostgreSQL Company >>> >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >> >> > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-17 06:48 Surinder Kumar <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Surinder Kumar @ 2016-10-17 06:48 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers On Sun, Oct 16, 2016 at 7:29 AM, Dave Page <[email protected]> wrote: > Hi > > I just found a case where this patch is broken - if you update the comment > on a type, it looks like it tried to lookup the schema ID using the type > name, which a) isn't in the posted data so gives a 500 response, and b) > wouldn't be safe anyway, if there were types with the same name in multiple > schemas. > βI have fixed this issue. Now it will lookup the schema ID against the type id instead of type name.β > > Actually, it looks like that's an issue when creating a type too - that is > also using an unsafe schema lookup. > > Please fix this ASAP (i.e. Monday) and double check to ensure we're not > doing any more unsafe lookups like this. > βIt looks good to me in other nodes. Please find attached patch and review.β > > Thanks. > > > On Friday, October 14, 2016, Dave Page <[email protected]> wrote: > >> Thanks, applied. >> >> On Friday, October 14, 2016, Surinder Kumar < >> [email protected]> wrote: >> >>> Hi >>> >>> *Following are the issues fixed in nodes:* >>> >>> 1) If we create/update a node with non-default schema, It should return >>> selected schema id in return response. but default schema id is returned >>> every time due to which it throws error in properties panel. >>> Fixed in Domains, Collation, Types, Views & Table node. >>> >>> 2) Incorrect parent id of object node is returned from *nodes method* >>> due to which wrong parent id is passed while updating object and >>> thus node didn't get refreshed. >>> Fixed in FTS Configuration, FTS Parser nodes. >>> >>> Also, I have kept changes of first patch which are essential to refresh >>> node every time. Without that patch nodes properties panel updates only >>> sometimes. >>> >>> Please find attached patch. Please review and let me know for comments. >>> >>> Thanks >>> Surinder Kumar >>> >>> >>> >>> On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected]> wrote: >>> >>>> Umm, no it wasn't - sorry. >>>> >>>> I see the same issue with Types. Can you fix that, and check all other >>>> nodes as well please? >>>> >>>> Thanks. >>>> >>>> On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> wrote: >>>> > Thanks, applied. >>>> > >>>> > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar >>>> > <[email protected]> wrote: >>>> >> Hi, >>>> >> >>>> >> Please find updated patch with changes: >>>> >> 1) On debugging through JS files, the issue was in synonym update >>>> method >>>> >> which wasn't returning node object. >>>> >> 2) retrieving schema name in node.sql for creating node object in >>>> update >>>> >> method. >>>> >> >>>> >> Please review and let me know for comments. >>>> >> >>>> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> >>>> wrote: >>>> >>> >>>> >>> Hi >>>> >>> >>>> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >>>> >>> <[email protected]> wrote: >>>> >>> > Hi >>>> >>> > >>>> >>> > Issue: >>>> >>> > on updating node, we deselect and then again select the node >>>> updated to >>>> >>> > refresh the panel. but it needs some delay of few milliseconds >>>> between >>>> >>> > deselect and select to fix this issue. >>>> >>> > >>>> >>> > Please find attached patch and review. >>>> >>> >>>> >>> This does not resolve the issue for me. I tested using a synonym to >>>> a >>>> >>> package on EPAS 9.5, by changing the target package name. >>>> >>> >>>> >>> >>>> >>> -- >>>> >>> Dave Page >>>> >>> Blog: http://pgsnake.blogspot.com >>>> >>> Twitter: @pgsnake >>>> >>> >>>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>>> >>> The Enterprise PostgreSQL Company >>>> >> >>>> >> >>>> > >>>> > >>>> > >>>> > -- >>>> > Dave Page >>>> > Blog: http://pgsnake.blogspot.com >>>> > Twitter: @pgsnake >>>> > >>>> > EnterpriseDB UK: http://www.enterprisedb.com >>>> > The Enterprise PostgreSQL Company >>>> >>>> >>>> >>>> -- >>>> Dave Page >>>> Blog: http://pgsnake.blogspot.com >>>> Twitter: @pgsnake >>>> >>>> EnterpriseDB UK: http://www.enterprisedb.com >>>> The Enterprise PostgreSQL Company >>>> >>> >>> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> >> > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] fix_unsafe_schema_lookup_issue_in_type.patch (2.6K, 3-fix_unsafe_schema_lookup_issue_in_type.patch) download | inline diff: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py index e6b7f3c..24b016a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py @@ -906,12 +906,13 @@ class TypeView(PGChildNodeView, DataTypeReader): if not status: return internal_server_error(errormsg=res) - # we need scid to update in browser tree - SQL = render_template("/".join([self.template_path, - 'get_scid.sql']), tname=data['name']) - status, scid = self.conn.execute_scalar(SQL) - if not status: - return internal_server_error(errormsg=scid) + if 'schema' in data: + # we need scid to update in browser tree + SQL = render_template("/".join([self.template_path, + 'get_scid.sql']), schema=data['schema']) + status, scid = self.conn.execute_scalar(SQL) + if not status: + return internal_server_error(errormsg=scid) # we need oid to to add object in tree at browser SQL = render_template("/".join([self.template_path, @@ -956,7 +957,7 @@ class TypeView(PGChildNodeView, DataTypeReader): return internal_server_error(errormsg=res) SQL = render_template("/".join([self.template_path, - 'get_scid.sql']), tname=data['name']) + 'get_scid.sql']), tid=tid) # Get updated schema oid status, scid = self.conn.execute_scalar(SQL) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql index 696a205..067a986 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/get_scid.sql @@ -1,6 +1,15 @@ +{% if tid %} SELECT t.typnamespace as scid FROM pg_type t WHERE - t.typname = {{tname|qtLiteral}}::text; + t.oid = {{tid}}::oid; +{% else %} +SELECT + ns.oid as scid +FROM + pg_namespace ns +WHERE + ns.nspname = {{schema|qtLiteral}}::text; +{% endif %} ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-18 10:33 Dave Page <[email protected]> parent: Surinder Kumar <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Dave Page @ 2016-10-18 10:33 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Thanks - applied! On Mon, Oct 17, 2016 at 7:48 AM, Surinder Kumar <[email protected]> wrote: > On Sun, Oct 16, 2016 at 7:29 AM, Dave Page <[email protected]> wrote: >> >> Hi >> >> I just found a case where this patch is broken - if you update the comment >> on a type, it looks like it tried to lookup the schema ID using the type >> name, which a) isn't in the posted data so gives a 500 response, and b) >> wouldn't be safe anyway, if there were types with the same name in multiple >> schemas. > > I have fixed this issue. Now it will lookup the schema ID against the type > id instead of type name. >> >> >> Actually, it looks like that's an issue when creating a type too - that is >> also using an unsafe schema lookup. >> >> Please fix this ASAP (i.e. Monday) and double check to ensure we're not >> doing any more unsafe lookups like this. > > It looks good to me in other nodes. > Please find attached patch and review. >> >> >> Thanks. >> >> >> On Friday, October 14, 2016, Dave Page <[email protected]> wrote: >>> >>> Thanks, applied. >>> >>> On Friday, October 14, 2016, Surinder Kumar >>> <[email protected]> wrote: >>>> >>>> Hi >>>> >>>> Following are the issues fixed in nodes: >>>> >>>> 1) If we create/update a node with non-default schema, It should return >>>> selected schema id in return response. but default schema id is returned >>>> every time due to which it throws error in properties panel. >>>> Fixed in Domains, Collation, Types, Views & Table node. >>>> >>>> 2) Incorrect parent id of object node is returned from nodes method due >>>> to which wrong parent id is passed while updating object and >>>> thus node didn't get refreshed. >>>> Fixed in FTS Configuration, FTS Parser nodes. >>>> >>>> Also, I have kept changes of first patch which are essential to refresh >>>> node every time. Without that patch nodes properties panel updates only >>>> sometimes. >>>> >>>> Please find attached patch. Please review and let me know for comments. >>>> >>>> Thanks >>>> Surinder Kumar >>>> >>>> >>>> >>>> On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected]> wrote: >>>>> >>>>> Umm, no it wasn't - sorry. >>>>> >>>>> I see the same issue with Types. Can you fix that, and check all other >>>>> nodes as well please? >>>>> >>>>> Thanks. >>>>> >>>>> On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> wrote: >>>>> > Thanks, applied. >>>>> > >>>>> > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar >>>>> > <[email protected]> wrote: >>>>> >> Hi, >>>>> >> >>>>> >> Please find updated patch with changes: >>>>> >> 1) On debugging through JS files, the issue was in synonym update >>>>> >> method >>>>> >> which wasn't returning node object. >>>>> >> 2) retrieving schema name in node.sql for creating node object in >>>>> >> update >>>>> >> method. >>>>> >> >>>>> >> Please review and let me know for comments. >>>>> >> >>>>> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> >>>>> >> wrote: >>>>> >>> >>>>> >>> Hi >>>>> >>> >>>>> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >>>>> >>> <[email protected]> wrote: >>>>> >>> > Hi >>>>> >>> > >>>>> >>> > Issue: >>>>> >>> > on updating node, we deselect and then again select the node >>>>> >>> > updated to >>>>> >>> > refresh the panel. but it needs some delay of few milliseconds >>>>> >>> > between >>>>> >>> > deselect and select to fix this issue. >>>>> >>> > >>>>> >>> > Please find attached patch and review. >>>>> >>> >>>>> >>> This does not resolve the issue for me. I tested using a synonym to >>>>> >>> a >>>>> >>> package on EPAS 9.5, by changing the target package name. >>>>> >>> >>>>> >>> >>>>> >>> -- >>>>> >>> Dave Page >>>>> >>> Blog: http://pgsnake.blogspot.com >>>>> >>> Twitter: @pgsnake >>>>> >>> >>>>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>>>> >>> The Enterprise PostgreSQL Company >>>>> >> >>>>> >> >>>>> > >>>>> > >>>>> > >>>>> > -- >>>>> > Dave Page >>>>> > Blog: http://pgsnake.blogspot.com >>>>> > Twitter: @pgsnake >>>>> > >>>>> > EnterpriseDB UK: http://www.enterprisedb.com >>>>> > The Enterprise PostgreSQL Company >>>>> >>>>> >>>>> >>>>> -- >>>>> Dave Page >>>>> Blog: http://pgsnake.blogspot.com >>>>> Twitter: @pgsnake >>>>> >>>>> EnterpriseDB UK: http://www.enterprisedb.com >>>>> The Enterprise PostgreSQL Company >>>> >>>> >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-20 06:58 Surinder Kumar <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 12+ messages in thread From: Surinder Kumar @ 2016-10-20 06:58 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers Hi, While fixing RM1840, I found when we add new index, it doesn't add under right parent. i.e. columns collection. because wrong parent is given in response. I also verified other nodes. This issue is only with index node. Do, I need to create separate RM for this case. ? Please find attached minor patch and review. On Tue, Oct 18, 2016 at 4:03 PM, Dave Page <[email protected]> wrote: > Thanks - applied! > > On Mon, Oct 17, 2016 at 7:48 AM, Surinder Kumar > <[email protected]> wrote: > > On Sun, Oct 16, 2016 at 7:29 AM, Dave Page <[email protected]> wrote: > >> > >> Hi > >> > >> I just found a case where this patch is broken - if you update the > comment > >> on a type, it looks like it tried to lookup the schema ID using the type > >> name, which a) isn't in the posted data so gives a 500 response, and b) > >> wouldn't be safe anyway, if there were types with the same name in > multiple > >> schemas. > > > > I have fixed this issue. Now it will lookup the schema ID against the > type > > id instead of type name. > >> > >> > >> Actually, it looks like that's an issue when creating a type too - that > is > >> also using an unsafe schema lookup. > >> > >> Please fix this ASAP (i.e. Monday) and double check to ensure we're not > >> doing any more unsafe lookups like this. > > > > It looks good to me in other nodes. > > Please find attached patch and review. > >> > >> > >> Thanks. > >> > >> > >> On Friday, October 14, 2016, Dave Page <[email protected]> wrote: > >>> > >>> Thanks, applied. > >>> > >>> On Friday, October 14, 2016, Surinder Kumar > >>> <[email protected]> wrote: > >>>> > >>>> Hi > >>>> > >>>> Following are the issues fixed in nodes: > >>>> > >>>> 1) If we create/update a node with non-default schema, It should > return > >>>> selected schema id in return response. but default schema id is > returned > >>>> every time due to which it throws error in properties panel. > >>>> Fixed in Domains, Collation, Types, Views & Table node. > >>>> > >>>> 2) Incorrect parent id of object node is returned from nodes method > due > >>>> to which wrong parent id is passed while updating object and > >>>> thus node didn't get refreshed. > >>>> Fixed in FTS Configuration, FTS Parser nodes. > >>>> > >>>> Also, I have kept changes of first patch which are essential to > refresh > >>>> node every time. Without that patch nodes properties panel updates > only > >>>> sometimes. > >>>> > >>>> Please find attached patch. Please review and let me know for > comments. > >>>> > >>>> Thanks > >>>> Surinder Kumar > >>>> > >>>> > >>>> > >>>> On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected]> wrote: > >>>>> > >>>>> Umm, no it wasn't - sorry. > >>>>> > >>>>> I see the same issue with Types. Can you fix that, and check all > other > >>>>> nodes as well please? > >>>>> > >>>>> Thanks. > >>>>> > >>>>> On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> > wrote: > >>>>> > Thanks, applied. > >>>>> > > >>>>> > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar > >>>>> > <[email protected]> wrote: > >>>>> >> Hi, > >>>>> >> > >>>>> >> Please find updated patch with changes: > >>>>> >> 1) On debugging through JS files, the issue was in synonym update > >>>>> >> method > >>>>> >> which wasn't returning node object. > >>>>> >> 2) retrieving schema name in node.sql for creating node object in > >>>>> >> update > >>>>> >> method. > >>>>> >> > >>>>> >> Please review and let me know for comments. > >>>>> >> > >>>>> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> > >>>>> >> wrote: > >>>>> >>> > >>>>> >>> Hi > >>>>> >>> > >>>>> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar > >>>>> >>> <[email protected]> wrote: > >>>>> >>> > Hi > >>>>> >>> > > >>>>> >>> > Issue: > >>>>> >>> > on updating node, we deselect and then again select the node > >>>>> >>> > updated to > >>>>> >>> > refresh the panel. but it needs some delay of few milliseconds > >>>>> >>> > between > >>>>> >>> > deselect and select to fix this issue. > >>>>> >>> > > >>>>> >>> > Please find attached patch and review. > >>>>> >>> > >>>>> >>> This does not resolve the issue for me. I tested using a synonym > to > >>>>> >>> a > >>>>> >>> package on EPAS 9.5, by changing the target package name. > >>>>> >>> > >>>>> >>> > >>>>> >>> -- > >>>>> >>> Dave Page > >>>>> >>> Blog: http://pgsnake.blogspot.com > >>>>> >>> Twitter: @pgsnake > >>>>> >>> > >>>>> >>> EnterpriseDB UK: http://www.enterprisedb.com > >>>>> >>> The Enterprise PostgreSQL Company > >>>>> >> > >>>>> >> > >>>>> > > >>>>> > > >>>>> > > >>>>> > -- > >>>>> > Dave Page > >>>>> > Blog: http://pgsnake.blogspot.com > >>>>> > Twitter: @pgsnake > >>>>> > > >>>>> > EnterpriseDB UK: http://www.enterprisedb.com > >>>>> > The Enterprise PostgreSQL Company > >>>>> > >>>>> > >>>>> > >>>>> -- > >>>>> Dave Page > >>>>> Blog: http://pgsnake.blogspot.com > >>>>> Twitter: @pgsnake > >>>>> > >>>>> EnterpriseDB UK: http://www.enterprisedb.com > >>>>> The Enterprise PostgreSQL Company > >>>> > >>>> > >>> > >>> > >>> -- > >>> Dave Page > >>> Blog: http://pgsnake.blogspot.com > >>> Twitter: @pgsnake > >>> > >>> EnterpriseDB UK: http://www.enterprisedb.com > >>> The Enterprise PostgreSQL Company > >>> > >> > >> > >> -- > >> Dave Page > >> Blog: http://pgsnake.blogspot.com > >> Twitter: @pgsnake > >> > >> EnterpriseDB UK: http://www.enterprisedb.com > >> The Enterprise PostgreSQL Company > >> > > > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] RM1728_fix_for_index_node.patch (722B, 3-RM1728_fix_for_index_node.patch) download | inline diff: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py index 819f83c..4f20d61 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py @@ -623,7 +623,7 @@ class IndexesView(PGChildNodeView): return jsonify( node=self.blueprint.generate_browser_node( idx, - scid, + tid, data['name'], icon="icon-index" ) ^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited @ 2016-10-21 11:12 Dave Page <[email protected]> parent: Surinder Kumar <[email protected]> 0 siblings, 0 replies; 12+ messages in thread From: Dave Page @ 2016-10-21 11:12 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Thanks, applied (and I dealt with the RM). On Thu, Oct 20, 2016 at 7:58 AM, Surinder Kumar <[email protected]> wrote: > Hi, > > While fixing RM1840, I found when we add new index, it doesn't add under > right parent. i.e. columns collection. because wrong parent is given in > response. > I also verified other nodes. This issue is only with index node. > > Do, I need to create separate RM for this case. ? > > Please find attached minor patch and review. > > On Tue, Oct 18, 2016 at 4:03 PM, Dave Page <[email protected]> wrote: >> >> Thanks - applied! >> >> On Mon, Oct 17, 2016 at 7:48 AM, Surinder Kumar >> <[email protected]> wrote: >> > On Sun, Oct 16, 2016 at 7:29 AM, Dave Page <[email protected]> wrote: >> >> >> >> Hi >> >> >> >> I just found a case where this patch is broken - if you update the >> >> comment >> >> on a type, it looks like it tried to lookup the schema ID using the >> >> type >> >> name, which a) isn't in the posted data so gives a 500 response, and b) >> >> wouldn't be safe anyway, if there were types with the same name in >> >> multiple >> >> schemas. >> > >> > I have fixed this issue. Now it will lookup the schema ID against the >> > type >> > id instead of type name. >> >> >> >> >> >> Actually, it looks like that's an issue when creating a type too - that >> >> is >> >> also using an unsafe schema lookup. >> >> >> >> Please fix this ASAP (i.e. Monday) and double check to ensure we're not >> >> doing any more unsafe lookups like this. >> > >> > It looks good to me in other nodes. >> > Please find attached patch and review. >> >> >> >> >> >> Thanks. >> >> >> >> >> >> On Friday, October 14, 2016, Dave Page <[email protected]> wrote: >> >>> >> >>> Thanks, applied. >> >>> >> >>> On Friday, October 14, 2016, Surinder Kumar >> >>> <[email protected]> wrote: >> >>>> >> >>>> Hi >> >>>> >> >>>> Following are the issues fixed in nodes: >> >>>> >> >>>> 1) If we create/update a node with non-default schema, It should >> >>>> return >> >>>> selected schema id in return response. but default schema id is >> >>>> returned >> >>>> every time due to which it throws error in properties panel. >> >>>> Fixed in Domains, Collation, Types, Views & Table node. >> >>>> >> >>>> 2) Incorrect parent id of object node is returned from nodes method >> >>>> due >> >>>> to which wrong parent id is passed while updating object and >> >>>> thus node didn't get refreshed. >> >>>> Fixed in FTS Configuration, FTS Parser nodes. >> >>>> >> >>>> Also, I have kept changes of first patch which are essential to >> >>>> refresh >> >>>> node every time. Without that patch nodes properties panel updates >> >>>> only >> >>>> sometimes. >> >>>> >> >>>> Please find attached patch. Please review and let me know for >> >>>> comments. >> >>>> >> >>>> Thanks >> >>>> Surinder Kumar >> >>>> >> >>>> >> >>>> >> >>>> On Fri, Sep 23, 2016 at 6:00 PM, Dave Page <[email protected]> wrote: >> >>>>> >> >>>>> Umm, no it wasn't - sorry. >> >>>>> >> >>>>> I see the same issue with Types. Can you fix that, and check all >> >>>>> other >> >>>>> nodes as well please? >> >>>>> >> >>>>> Thanks. >> >>>>> >> >>>>> On Fri, Sep 23, 2016 at 1:29 PM, Dave Page <[email protected]> >> >>>>> wrote: >> >>>>> > Thanks, applied. >> >>>>> > >> >>>>> > On Fri, Sep 23, 2016 at 12:05 PM, Surinder Kumar >> >>>>> > <[email protected]> wrote: >> >>>>> >> Hi, >> >>>>> >> >> >>>>> >> Please find updated patch with changes: >> >>>>> >> 1) On debugging through JS files, the issue was in synonym update >> >>>>> >> method >> >>>>> >> which wasn't returning node object. >> >>>>> >> 2) retrieving schema name in node.sql for creating node object in >> >>>>> >> update >> >>>>> >> method. >> >>>>> >> >> >>>>> >> Please review and let me know for comments. >> >>>>> >> >> >>>>> >> On Fri, Sep 23, 2016 at 2:44 PM, Dave Page <[email protected]> >> >>>>> >> wrote: >> >>>>> >>> >> >>>>> >>> Hi >> >>>>> >>> >> >>>>> >>> On Fri, Sep 23, 2016 at 7:39 AM, Surinder Kumar >> >>>>> >>> <[email protected]> wrote: >> >>>>> >>> > Hi >> >>>>> >>> > >> >>>>> >>> > Issue: >> >>>>> >>> > on updating node, we deselect and then again select the node >> >>>>> >>> > updated to >> >>>>> >>> > refresh the panel. but it needs some delay of few milliseconds >> >>>>> >>> > between >> >>>>> >>> > deselect and select to fix this issue. >> >>>>> >>> > >> >>>>> >>> > Please find attached patch and review. >> >>>>> >>> >> >>>>> >>> This does not resolve the issue for me. I tested using a synonym >> >>>>> >>> to >> >>>>> >>> a >> >>>>> >>> package on EPAS 9.5, by changing the target package name. >> >>>>> >>> >> >>>>> >>> >> >>>>> >>> -- >> >>>>> >>> Dave Page >> >>>>> >>> Blog: http://pgsnake.blogspot.com >> >>>>> >>> Twitter: @pgsnake >> >>>>> >>> >> >>>>> >>> EnterpriseDB UK: http://www.enterprisedb.com >> >>>>> >>> The Enterprise PostgreSQL Company >> >>>>> >> >> >>>>> >> >> >>>>> > >> >>>>> > >> >>>>> > >> >>>>> > -- >> >>>>> > Dave Page >> >>>>> > Blog: http://pgsnake.blogspot.com >> >>>>> > Twitter: @pgsnake >> >>>>> > >> >>>>> > EnterpriseDB UK: http://www.enterprisedb.com >> >>>>> > The Enterprise PostgreSQL Company >> >>>>> >> >>>>> >> >>>>> >> >>>>> -- >> >>>>> Dave Page >> >>>>> Blog: http://pgsnake.blogspot.com >> >>>>> Twitter: @pgsnake >> >>>>> >> >>>>> EnterpriseDB UK: http://www.enterprisedb.com >> >>>>> The Enterprise PostgreSQL Company >> >>>> >> >>>> >> >>> >> >>> >> >>> -- >> >>> Dave Page >> >>> Blog: http://pgsnake.blogspot.com >> >>> Twitter: @pgsnake >> >>> >> >>> EnterpriseDB UK: http://www.enterprisedb.com >> >>> The Enterprise PostgreSQL Company >> >>> >> >> >> >> >> >> -- >> >> Dave Page >> >> Blog: http://pgsnake.blogspot.com >> >> Twitter: @pgsnake >> >> >> >> EnterpriseDB UK: http://www.enterprisedb.com >> >> The Enterprise PostgreSQL Company >> >> >> > >> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 12+ messages in thread
end of thread, other threads:[~2016-10-21 11:12 UTC | newest] Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-09-23 06:39 [pgAdmin4][Patch]: RM1728 - Properties are not refreshing after objects are edited Surinder Kumar <[email protected]> 2016-09-23 09:14 ` Dave Page <[email protected]> 2016-09-23 11:05 ` Surinder Kumar <[email protected]> 2016-09-23 12:29 ` Dave Page <[email protected]> 2016-09-23 12:30 ` Dave Page <[email protected]> 2016-10-14 10:01 ` Surinder Kumar <[email protected]> 2016-10-14 19:19 ` Dave Page <[email protected]> 2016-10-16 01:59 ` Dave Page <[email protected]> 2016-10-17 06:48 ` Surinder Kumar <[email protected]> 2016-10-18 10:33 ` Dave Page <[email protected]> 2016-10-20 06:58 ` Surinder Kumar <[email protected]> 2016-10-21 11:12 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox