Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b08St-0004TK-JA for pgadmin-hackers@arkaria.postgresql.org; Tue, 10 May 2016 14:16:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b08St-000868-4V for pgadmin-hackers@arkaria.postgresql.org; Tue, 10 May 2016 14:16:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b08Ss-000862-Dv for pgadmin-hackers@postgresql.org; Tue, 10 May 2016 14:16:46 +0000 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b08Sn-0002Vs-DY for pgadmin-hackers@postgresql.org; Tue, 10 May 2016 14:16:45 +0000 Received: by mail-oi0-x234.google.com with SMTP id v145so17483136oie.0 for ; Tue, 10 May 2016 07:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=XjM2K4dPrNOWS3ajoifpJJwTF8ppYuHSSsswZE2bhLo=; b=r76hjYdObSuENveATwwvkYTOeCthih79DKQcC7kvhmxaTxuMVbpQayMFCwlLFy/5ae Luf6sCkzoMGxsi+phn+Lby+AfWLI+/MAQh7K84RaxioDtUJTs/Au1HVmnxzjP6TgGneB t3Mh3usUzjzxMLdxxn8jkWzRZQF354Cli/9j9eBQ9PfbsA+5B06swXi9Cn2Ij80l76Go 7g1mvwRfsaGi5E5zgpnHkOJ9KeFfoMaeJSMCmoGi1SjmyKm1VEZJ/BCIluSKq92YrstO yRXhJoTSHQn0ta2jnDXP3jeyl0GXY4nOntQgQuS+GOcWWaPM4cjnACqp02V60h/cYLwq +HgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=XjM2K4dPrNOWS3ajoifpJJwTF8ppYuHSSsswZE2bhLo=; b=kiW5vxcjnrolvVACsMbvOYVXo50DHmpCsOYq4t3QuHNASEFhksGENJB46opPGRwhnM ZUWTuBeVoCbYjhRD4XwjDRpsmj6eKkCGe0MweppiA4yDELzc3yZS1NaY1PMfpCo21ZpE cNuyjLYBxgrgXoQsjwmsoQ/x3x/KmEE2nJP+s9f4ITIeKyeXakPbClkl3slr049/CPSH OU/Fcj/YYlT8w+t3qvk5XfAqZg+oiPcNYS5VlfH4ECyo60boZpbTZgAmzhF+/idC9zEk xQY2ql9X1xzy4cfIcn148z0rW+oNCH3reXUie0YBrZxpHlXLsezEC1bcZFEVh7Th8l1V MyMw== X-Gm-Message-State: AOPr4FXVT1YTcVXWqRvVkosx8iXkhGjGWbodOKbFcq0HGSyidPuHGw/5OrsbfSEXLZhx4nhic0NDw5aBSaZ9JpEv MIME-Version: 1.0 X-Received: by 10.202.105.198 with SMTP id e189mr15219891oic.195.1462889799645; Tue, 10 May 2016 07:16:39 -0700 (PDT) Received: by 10.202.175.148 with HTTP; Tue, 10 May 2016 07:16:39 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 May 2016 19:46:39 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: View and Materialised View Nodes From: Akshay Joshi To: Surinder Kumar Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a1141b266dabb5d05327d9257 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a1141b266dabb5d05327d9257 Content-Type: text/plain; charset=UTF-8 Hi Surinder On Fri, Apr 29, 2016 at 8:07 PM, Surinder Kumar wrote: > Hi, > > > PFA patch for View and Materialised View Nodes. > This patch is dependent on *tables node* and its subnodes patch. > Please test this patch once latest tables node patch is submitted. > > I have merged one other patch: > *"Don't show Security group of node if it is under Catalogs"* > > http://www.postgresql.org/message-id/CAM5-9D8RNZXRG0ygvuRqf2wQAEnye-rqBHSrwcr34dnLCemy3w@mail.gmail.com > > Below are the fix for the review comments given by Dave: > > *Views*: > > - Please add sqlCreateHelp and sqlAlterHelp properties to all nodes. > *I have added these in View and Materialised View. * > > - Some of the SQL templates have inconsistent indenting (i.e. not 4 > chars), e.g. > > CREATE OR REPLACE VIEW pem.avail_agents > AS > ... > *Fixed* > > - When creating any object, the Owner, Schema and Tablespace should > have default values. > *Fixed* > > - Property labels should only have the first word capitalised, e.g. > > Security barrier > Check options > *Fixed* > > - The Definition box on the View dialogue should start at a single > line and expand as needed - see the Function dialogue > *Fixed* > Still reproducible. > > > - The Cancel button doesn't work on the View dialog. Please check them all. > *In latest code pull, It **seems to be** fixed. not reproducible at my > end.* > > - The Save button doesn't close the View dialog, nor does it add the tree > node. > *In latest code pull, It **seems to be** fixed. not reproducible at my > end.* > > - Dependencies and Dependents don't show icons, and have very tall > rows. This issue likely comes from elsewhere as I'm seeing it on other > object types as well. > Yes, it is general, previously images were visible. It is regression of > some commit. I will check it. > > - Reverse engineered SQL for a column on a view is shown like: > > -- Column: id -- ALTER TABLE pem.avail_agents > DROP COLUMN id; ALTER TABLE pem.avail_agents ADD COLUMN id > integer(4); > > (yes, it's displaying the HTML tags) > *I pulled the latest code, but it is not reproducible.* > > - The ACL property should be called Privileges and be in the Security > group (see functions, sequences etc). > *Fixed* > > - The Schema should not be shown in "Properties" view. > *Fixed* > > - Fields in the General section should be in the order: Name, OID, > Owner, System xxx? (where appropriate), Comment > *I have checked that In view Fields (Name, Owner, Schema & Comment) are in > this order.* > *I didn't got your point. Can you please give and example, if possible.* > Not Fixed yet. > > > > *Materialised Views:* > - Selecting an MV results in: > > 2016-04-14 09:34:58,863: ERROR pgadmin: Exception on > /browser/materialized_view/obj/1/1/24587/27424/107612 [GET] > Traceback (most recent call last): > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/app.py", > line 1817, in wsgi_app > response = self.full_dispatch_request() > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/app.py", > line 1477, in full_dispatch_request > rv = self.handle_user_exception(e) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/app.py", > line 1381, in handle_user_exception > reraise(exc_type, exc_value, tb) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/app.py", > line 1475, in full_dispatch_request > rv = self.dispatch_request() > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/app.py", > line 1461, in dispatch_request > return self.view_functions[rule.endpoint](**req.view_args) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/views.py", > line 84, in view > return self.dispatch_request(*args, **kwargs) > File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line > 233, in dispatch_request > return method(*args, **kwargs) > File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_ > groups/servers/databases/schemas/views/__init__.py", > line 185, in wrap > return f(*args, **kwargs) > File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_ > groups/servers/databases/schemas/views/__init__.py", > line 1226, in properties > self.conn, result, 'table') > File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_ > groups/servers/databases/schemas/utils.py", > line 357, in parse_vacuum_data > vacuum_fields = render_template("vacuum_settings/vacuum_fields.json") > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/templating.py", > line 127, in render_template > return _render(ctx.app.jinja_env.get_or_select_template(template_ > name_or_list), > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/jinja2/environment.py", > line 830, in get_or_select_template > return self.get_template(template_name_or_list, parent, globals) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/jinja2/environment.py", > line 791, in get_template > return self._load_template(name, self.make_globals(globals)) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/jinja2/environment.py", > line 765, in _load_template > template = self.loader.load(self, name, globals) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/jinja2/loaders.py", > line 113, in load > source, filename, uptodate = self.get_source(environment, name) > File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- > packages/flask/templating.py", > line 64, in get_source > raise TemplateNotFound(template) > TemplateNotFound: vacuum_settings/vacuum_fields.json > > *It seems this patch* > > http://www.postgresql.org/message-id/CAM5-9D-4DYgMMHFc5mzDDdK++h7XNvkiA5ojBbXi5sTHmecGCA@mail.gmail.com > *wasn't applied properly. Now this patch is sent with tables patch.* > > - When creating an MV, an error is immediately shown telling me to > specify a name. We do not normally show such errors until the field > loses focus. > *Now its fixed.* > Not fixed. Issue is reproducible. > > > - No default owner is shown in create mode. > *Fixed.* > > - "Please enter function definition." is shown as an error on the > definition field. > *It triggers this error message as it is mandatory.* > > - The Definition field is missing a label. If relying on the tab title > to be the label, the control should fill the tab (as with Security > options etc). > *Fixed.* > > - No default tablespace is shown. > *Fixed* > > - If I enable custom auto-vacuum, there is no way to add a row to > specify options. > *You can enable custom auto vacuum field and add new values in the auto > vacuum settings.* > > - If I specify a comment on an MV, I get "ERROR: "mv_pg_tables" is not a > view" > *For some reason tablespace name was missing in generated sql.* > Not Fixed. Wrong sql generated "COMMENT ON VIEW ..." instead of "COMMENT ON MATERIALIZED VIEW ..." > > > - Save/Cancel buttons not working as expected (like other objects) > *In latest code pull, It **seems to be** fixed. not reproducible at my > end.* > Apart from above below are my review comments *Views*:- - As per pgAdmin3 "indexes" node should not be listed under Views. - SQL not generated when changing the value of "Event" and "Do Instead" for Rule node under View node. - Changing the "Event" in Rule node not working. - As per pgAdmin3 user can't be able to create columns inside View node. - User can't be able to delete/drop columns and system generated Rule's, Trigger's etc.. - Found one issue when changing value of "Security Barrier" from "Yes" to "No" it is not reflected on GUI when we open the dialog again while in backend value is updated, but on GUI it is showing "Yes". - Create -> Trigger menu is missing when any view node is selected. *Materialized View:-* - *As per pgAdmin3 user can't be able to create columns inside Materialized View node. * - *User can't be able to delete/drop columns and system generated Rule's, Trigger's etc.. * - Create -> Trigger/Rule/Index menu is missing when any materialized view node is selected. - In pgAdmin3 we have two more refresh options "Refresh data" and "Refresh data concurrently" which is missing. - "Custom Auto Vaccum" for Table and Toast Table not working. > > Thanks, > Surinder Kumar > > > > -- > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > > -- *Akshay Joshi* *Principal Software Engineer * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* --001a1141b266dabb5d05327d9257 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Surinder=

On Fri, Ap= r 29, 2016 at 8:07 PM, Surin= der Kumar <surinder.= kumar@enterprisedb.com> wrot= e:
Hi,


PFA patch for View and Materialised View Nodes.
This patch is = dependent on=C2=A0tables node=C2=A0and its subnodes=C2=A0patc= h.
Please test this patch once latest tables node patch is submit= ted.

I have merged one other patch:
"Don't show Security group of node if it is under Catalo= gs"

Below = are the fix for the review comments given by Dave:

Views:

- Please add sqlCreateHelp and sqlAlterHe= lp properties to all nodes.
I have added these in Vi= ew and Materialised View.=C2=A0

- Some of the SQL templates have inconsi= stent indenting (i.e. not 4 chars), e.g.

CREATE OR REPL= ACE VIEW pem.avail_agents
=C2=A0AS
=C2=A0...
Fixed

- When creating any object, the Owner, Schema and Tablespace should
have default v= alues.
Fixed
- Property labels = should only have the first word capitalised, e.g.

=C2= =A0 Security barrier
=C2=A0 Check options
Fixed

- The Definition box on the View dialogue should start at a single<= /span>
line and = expand as needed - see the Function dialogue
Fixed

=C2=A0 =C2=A0Still repro= ducible. =C2=A0


-= The Cancel button doesn't work on the View dialog. Please check them a= ll.
In latest code pull, It=C2=A0= seems to be=C2=A0fixed. not=C2=A0reproducible=C2=A0at my end.=

- The Save button doesn't close the View dialog, nor does it add the= tree node.
In latest code pu= ll, It=C2=A0seems to be=C2=A0fixed. not=C2=A0re= producible=C2=A0at my end.

- Dependencies and Dependents don't show i= cons, and have very tall
rows. This issue likely comes from elsewhere as I'm see= ing it on other
object types as well.
Yes, it is general, previously images were visible. It is regression of s= ome commit. I will check it.

- Reverse engineered= SQL for a column on a view is shown like:

<html>= <head></head><body>-- Column: id -- ALTER TABLE pem.avail= _agents
D= ROP COLUMN id; ALTER TABLE pem.avail_agents ADD COLUMN id
integer(4);</body>= </html>

(yes, it's displaying the HTML tags)<= /span>
I pulled the latest code, but it i= s not reproducible.

- The ACL property should be called Privileges and be in th= e Security
group (see functions, sequences etc).
Fixed

- The Schema should not be shown in "Properties" v= iew.
Fixed

- Fields in the Gene= ral section should be in the order: Name, OID,
Owner, System xxx? (where appropriate= ), Comment
I have checked that In view Fields (N= ame, Owner, Schema & Comment) are in this order.
<= i>I didn't got your point. Can you please give and example, if possible= .

=C2=A0 =C2=A0Not Fixe= d yet.=C2=A0

Materialised Views:
- Selecting an MV results in:

2016-04-14= 09:34:58,863: ERROR pgadmin: Exception on
/browser/materialized_view/obj/1/1/24587/27424/107612 [GET]
Traceback (most recent call= last):
= =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pa= ckages/flask/app.py",
line 1817, in wsgi_app
=C2=A0 =C2=A0 response =3D self.full_disp= atch_request()
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1477, in full_dispatch_request
=C2=A0 =C2=A0 rv =3D sel= f.handle_user_exception(e)
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1381, in handle_user_exception=
=C2=A0 = =C2=A0 reraise(exc_type, exc_value, tb)
= =C2=A0 File "/Users/dpage/.virtualenvs/= pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1475, in full_dispa= tch_request
=C2=A0 =C2=A0 rv =3D self.dispatch_request()
=C2=A0 File "/Users/dpage/.virt= ualenvs/pgadmin4/lib/python2.7/site-<= /span>packages/flask/app.py",line 1461, in disp= atch_request
=C2=A0 =C2=A0 return self.view_functions[rule.endpoint](**req.view_args)
= =C2=A0 File "/Users/dpage/.virtualenvs/= pgadmin4/lib/python2.7/site-packages/flask/views.py",

line 84, in view<= br style=3D"font-size:13px">=C2=A0 =C2=A0 re= turn self.dispatch_request(*args, **kwargs)
=C2=A0 File "/Users/dpage/git/pgadm= in4/web/pgadmin/browser/utils.py"= ;, line
2= 33, in dispatch_request
=C2=A0 =C2=A0 return method(*args, **kwargs)
=C2=A0 File "/Users= /dpage/git/pgadmin4/web/pgadmin/brows= er/server_groups/servers/databases/schemas/views/__init__.py",=
line 185, in wr= ap
=C2=A0= =C2=A0 return f(*args, **kwargs)
=C2=A0 File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py",
line 1226, in properties
=C2=A0 =C2=A0 self.conn,= result, 'table')
=C2=A0 File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py",
line 357, in parse_vacuum_data
=C2=A0 =C2=A0 vacuum_fields =3D rend= er_template("vacuum_settings/vac= uum_fields.json")
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/templating.py",
line 127, in render_template<= br style=3D"font-size:13px">=C2=A0 =C2=A0 re= turn _render(ctx.app.jinja_env.get_or= _select_template(template_name_or_lis= t),
=C2= =A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa= ges/jinja2/environment.py",

line 830, in = get_or_select_template
=C2=A0 =C2=A0 return self.get_template(template_name_or_list, parent, globals)
=C2=A0 File "/Users/dpa= ge/.virtualenvs/pgadmin4/lib/python2.= 7/site-packages/jinja2/environment.py",
line 791, in get_template
=C2=A0 =C2=A0 return = self._load_template(name, self.make_globals(globals))
=C2=A0 File "/Users/dpage= /.virtualenvs/pgadmin4/lib/python2.7/= site-packages/jinja2/environment.py",
line 765, in _load_template
=C2=A0 =C2=A0 templat= e =3D self.loader.load(self, name, globals)
=C2=A0 File "/Users/dpage/.virtuale= nvs/pgadmin4/lib/python2.7/site-packages/jinja2/loaders.py",line 113, in load=
=C2=A0 = =C2=A0 source, filename, uptodate =3D self.get_source(environment, name)
=C2=A0 File= "/Users/dpage/.virtualenvs/pgad= min4/lib/python2.7/site-packages/flas= k/templating.py",
line 64, in get_source
=C2=A0 =C2=A0 raise TemplateNotFound(template)<= /span>
TemplateN= otFound: vacuum_settings/vacuum_fields.json

It seems this patch
=
wasn't applied properly= . Now this patch is sent with tables patch.

- When creating an MV, an er= ror is immediately shown telling me to
<= span style=3D"font-size:13px">specify a name. We do not normally show such = errors until the field
loses focus.
Now its fixed.

=C2=A0 =C2=A0 Not fixed. Issue is= reproducible. =C2=A0


- No default owner is shown in create mode.
Fix= ed.

- "Please enter function definition." is= shown as an error on the
definition field.
It triggers this = error message as it is mandatory.

- The Definition fie= ld is missing a label. If relying on the tab title
to be the label, the control shou= ld fill the tab (as with Security
options etc).
Fixed.

- No default tablespace is shown.
Fix= ed

- If I enable custom auto-vacuum, there is no way t= o add a row to
specify options.
You can enable custom auto va= cuum field and add new values in the auto vacuum settings.

- If I specify a comment on an MV, I get "ERROR: "mv_pg_tabl= es" is not a view"
For some reason tablesp= ace name was missing in generated sql.

=C2=A0 =C2=A0Not Fixed. Wrong sql generated "COMMENT ON VIEW ..." inst= ead of "COMMENT ON MATERIALIZED VIEW ..."
=


- Save/Cancel buttons not working as ex= pected (like other objects)
In latest code pull,= It=C2=A0seems to be=C2=A0fixed. not=C2=A0repro= ducible=C2=A0at my end.


=C2=A0 =C2=A0Apart from above below are my review comments= =C2=A0

=C2=A0 =C2=A0Views:-=C2=A0
  • As per pgAdmin3 "indexes" node should not be listed unde= r Views.
  • SQL = not generated when changing the value of "Event" and "Do Ins= tead" for Rule node under View node.
  • Changing the "Event&= quot; in Rule node not working.
  • As per pgAdmin3 user can't be a= ble to create columns inside View node.=C2=A0
  • User can't be abl= e to delete/drop columns and system generated Rule's, Trigger's etc= ..=C2=A0
  • Found one issue when changing value of "Security Barr= ier" from "Yes" to "No" it is not reflected on GUI= when we open the dialog again while in backend<= /span> value is updated, but on GUI it is showing "Yes".
  • = Create -> Trigger menu is missing when any view node is selected.=C2=A0<= /li>

=C2=A0 =C2=A0Materialized View:-<= /div>
  • As per pgAdmin3 use= r can't be able to create columns inside Materialized View node.=
  • User can't be ab= le to delete/drop columns and system generated Rule's, Trigger's et= c..
  • Create -> Trigger/Rule/Index menu is missing = when any materialized view node is selected.
  • In pgAdmin3 we have tw= o more refresh options "Refresh data" and "Refresh data conc= urrently" which is missing.
  • "Custom Auto Vaccum" for Table and Toast Tab= le not working.=C2=A0



Thanks,
Suri= nder Kumar



--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers=




--
Aks= hay Joshi
Principal Software Engineer=C2=A0


Phone: +91 20-3058-9517
Mobile: +91 976-7= 88-8246
--001a1141b266dabb5d05327d9257--