[pgadmin-hackers] Fwd: [pgAdmin 4 - Bug #1191] proper code "select new_empno();" should displayed in query tool window for function new_empno()

2016-06-21 Thread Sanket Mehta
Hi,

I have resolved the issue and patch is attached with this mail.
Please do review it and let me know if any changes required.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

-- Forwarded message --
From: <redm...@postgresql.org>
Date: Mon, Jun 13, 2016 at 3:10 PM
Subject: [pgAdmin 4 - Bug #1191] proper code "select new_empno();" should
displayed in query tool window for function new_empno()
To: fahar.ab...@enterprisedb.com, guilla...@lelarge.info,
priyanka.shen...@enterprisedb.com, surinder.ku...@enterprisedb.com,
neel.pa...@enterprisedb.com, akshay.jo...@enterprisedb.com,
sanket.me...@enterprisedb.com


Issue #1191 has been updated by Dave Page.

   - *Target version* changed from *1.0 Beta 1* to *1.0 Beta 2*

--
Bug #1191: proper code "select new_empno();" should displayed in query tool
window for function new_empno()
<https://redmine.postgresql.org/issues/1191#change-2626>

   - Author: Fahar Abbas
   - Status: New
   - Priority: Normal
   - Assignee:
   - Category:
   - Target version: 1.0 Beta 2

Platform:
Ubuntu 14.04 Linux 64:
---
Browser version:
--
28.0 Mozilla Firefox for ubuntu

If User "select script" for function new_empno(), following output
displayed:

SELECT
<>p
<>u
<>b
<>l
<>i
<>c
<>.
<>n
<>e
<>w
<>_

Steps:

1. Launch pgAdmin4 on Ubuntu 14.04 Linux 64
2. Connect to PPAS-9.5 server
3. Expand function node
4. Right click and select script for function new_empno()

Expected result:

proper code "select new_empno();" should displayed
Files Screen Shot 2016-05-18 at 2.09.03 pm.png
<https://redmine.postgresql.org/attachments/download/1029/Screen%20Shot%202016-05-18%20at%202.09.03%20pm.png>
(879 KB)
Screen Shot 2016-05-18 at 2.37.16 pm.png
<https://redmine.postgresql.org/attachments/download/1030/Screen%20Shot%202016-05-18%20at%202.37.16%20pm.png>
(982 KB)
--

You have received this notification because you have either subscribed to
it, or are involved in it.
To change your notification preferences, please click here:
https://redmine.postgresql.org/my/account
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py
index fc85268..0a41230 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py
@@ -1244,16 +1244,18 @@ It may have been removed by another user or moved to another schema.
 func_def, name = res['rows'][0]
 
 # Fetch only arguments
-args = name[name.rfind('('):].strip('(').strip(')').split(',')
-# Remove unwanted spaces from arguments
-args = [arg.strip(' ') for arg in args]
+argString = name[name.rfind('('):].strip('(').strip(')')
+if len(argString) > 0:
+args = argString.split(',')
+# Remove unwanted spaces from arguments
+args = [arg.strip(' ') for arg in args]
+
+# Remove duplicate and then format arguments
+for arg in list(set(args)):
+formatted_arg = '\n\t<' + arg + '>'
+name = name.replace(arg, formatted_arg)
+name = name.replace(')', '\n)')
 
-# Remove duplicate and then format arguments
-for arg in list(set(args)):
-formatted_arg = '\n\t<' + arg + '>'
-name = name.replace(arg, formatted_arg)
-
-name = name.replace(')', '\n)')
 sql = "SELECT {0}".format(name)
 
 return ajax_response(response=sql)

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


[pgadmin-hackers] Re: [pgAdmin 4 - Bug #1292] ERROR: template database "!@#$%^&*()_+{}|:"<>?=-\\][';/.," does not exist message throws if template database contain special charterers

2016-06-20 Thread Sanket Mehta
Hi,

PFA the revised patch to resolve this issue which consists the change in
control formatter.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Jun 13, 2016 at 3:12 PM, <redm...@postgresql.org> wrote:

> Issue #1292 has been updated by Dave Page.
>
>- *Target version* deleted (*1.0 Beta 1*)
>
> --
> Bug #1292: ERROR: template database "!@#$%^&*()_+{}|:"<>?=-\\][';/.," does
> not exist message throws if template database contain special charterers
> <https://redmine.postgresql.org/issues/1292#change-2631>
>
>- Author: Fahar Abbas
>    - Status: In Progress
>- Priority: Normal
>- Assignee: Sanket Mehta
>- Category:
>- Target version:
>
> Commit ID:
> ---
> commit 954163b4957c1dce89c0632d009b845cbe90faf4
>
> Browser version:
> 
> Firefox 45.0.2
>
> Python version:
> 
> 3.5.1+
>
> Platforms:
> All
>
> ERROR: template database "!@#$%^&*()_+{}|:"<>?=-\\][';/.," does not exist
> message throws if user try to create database with template database that
> name contain special charterers.
>
> Please note that this issue is not reproducible in other template
> databases that name is simple one.
>
> Please note that this is not reproduce in pgAdmin3.
>
> Steps:
>
> 1. Install pgAdmin4 on Ubuntu 16.04
> 2. Install PG-9.6-beta 1 installer
> 3. Expand database node
> 4. give it's name !#$%^&*()_+{}|:"<>?=-\][';/.,
> 5. Database created successfully
> 6. Again create new database and give it's name abcd
> 7. Click on definition tab
> 8. select template database !#$%^&*()_+{}|:"<>?=-\][';/.,
> 9. Click on Save button
> Files Screen Shot 2016-06-02 at 10.25.34 am.png
> <https://redmine.postgresql.org/attachments/download/1197/Screen%20Shot%202016-06-02%20at%2010.25.34%20am.png>
> (1020 KB)
> Screen Shot 2016-06-02 at 10.26.01 am.png
> <https://redmine.postgresql.org/attachments/download/1198/Screen%20Shot%202016-06-02%20at%2010.26.01%20am.png>
> (1.03 MB)
> --
>
> You have received this notification because you have either subscribed to
> it, or are involved in it.
> To change your notification preferences, please click here:
> https://redmine.postgresql.org/my/account
>
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index c33289c..4466c1c 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1787,7 +1787,7 @@
   var Select2Formatter = function() {};
   _.extend(Select2Formatter.prototype, {
 fromRaw: function(rawData, model) {
-  return JSON.stringify(_.escape(rawData));
+  return JSON.parse(JSON.stringify(_.escape(rawData)));
 },
 toRaw: function(formattedData, model) {
   return formattedData;

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


[pgadmin-hackers] integration of minimap in graphical explain feature

2016-06-14 Thread Sanket Mehta
Hi,

PFA the patch for integration of minimap in graphical explain.
It will show minimap on left top corner of graphical explain.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/misc/__init__.py b/web/pgadmin/misc/__init__.py
index 2081822..6b307e3 100644
--- a/web/pgadmin/misc/__init__.py
+++ b/web/pgadmin/misc/__init__.py
@@ -33,6 +33,14 @@ class MiscModule(PgAdminModule):
 'snap.svg' if config.DEBUG else 'snap.svg-min'
 )),
 'preloaded': False
+}, {
+'name': 'imageviewer',
+'path': url_for(
+'misc.static', filename='explain/js/' + (
+'imageviewer.pgadmin' if config.DEBUG else 'imageviewer-min'
+)),
+'exports': 'ImageViewer',
+'preloaded': False
 }]
 
 def get_own_stylesheets(self):
@@ -40,6 +48,9 @@ class MiscModule(PgAdminModule):
 stylesheets.append(
 url_for('misc.static', filename='explain/css/explain.css')
 )
+stylesheets.append(
+url_for('misc.static', filename='explain/css/imageviewer.css')
+)
 return stylesheets
 
 
diff --git a/web/pgadmin/misc/static/explain/css/imageviewer.css b/web/pgadmin/misc/static/explain/css/imageviewer.css
new file mode 100644
index 000..8fc6c0f
--- /dev/null
+++ b/web/pgadmin/misc/static/explain/css/imageviewer.css
@@ -0,0 +1,226 @@
+/*
+ImageViewer v 1.1.0
+Author: Sudhanshu Yadav
+Copyright (c) 2015 to Sudhanshu Yadav - ignitersworld.com , released under the MIT license.
+Demo on: http://ignitersworld.com/lab/imageViewer.html
+*/
+
+/* image viewer css */
+#iv-container {
+  position: fixed;
+  background: #0d0d0d;
+  width: 100%;
+  height: 100%;
+  top: 0;
+  left: 0;
+  display: none;
+  z-index: 1000;
+}
+
+.iv-container {
+  overflow: auto;
+}
+
+.iv-close {
+  width: 32px;
+  height: 32px;
+  position: absolute;
+  right: 20px;
+  top: 20px;
+  cursor: pointer;
+  text-align: center;
+  overflow: hidden;
+  text-shadow: 0px 0px 3px #6d6d6d;
+  -webkit-transition: all ease 200ms;
+  -moz-transition: all ease 200ms;
+  -o-transition: all ease 200ms;
+  transition: all ease 200ms;
+}
+.iv-close:after,
+.iv-close:before {
+  content: "";
+  height: 4px;
+  width: 32px;
+  background: #FFF;
+  position: absolute;
+  left: 0;
+  top: 50%;
+  margin-top: -2px;
+}
+.iv-close:before {
+  -webkit-transform: rotate(45deg);
+  -moz-transform: rotate(45deg);
+  -ms-transform: rotate(45deg);
+  -o-transform: rotate(45deg);
+  transform: rotate(45deg);
+}
+.iv-close:after {
+  -webkit-transform: rotate(-45deg);
+  -moz-transform: rotate(-45deg);
+  -ms-transform: rotate(-45deg);
+  -o-transform: rotate(-45deg);
+  transform: rotate(-45deg);
+}
+.iv-close:hover {
+  -webkit-transform: rotate(90deg);
+  -moz-transform: rotate(90deg);
+  -ms-transform: rotate(90deg);
+  -o-transform: rotate(90deg);
+  transform: rotate(90deg);
+}
+/* snap view css */
+.iv-snap-view {
+  width: 150px;
+  height: 150px;
+  position: absolute;
+  top: 20px;
+  left: 20px;
+  border: 1px solid #666;
+  background: black;
+  z-index: 100;
+  -webkit-box-sizing: content-box;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+  -webkit-transition: all ease 400ms;
+  -moz-transition: all ease 400ms;
+  -o-transition: all ease 400ms;
+  transition: all ease 400ms;
+  opacity: 0;
+}
+
+.iv-snap-image-wrap {
+  display: inline-block;
+  position: absolute;
+  max-width: 150px;
+  max-height: 150px;
+  top: 50%;
+  left: 50%;
+  -webkit-transform: translate(-50%, -50%);
+  -moz-transform: translate(-50%, -50%);
+  -ms-transform: translate(-50%, -50%);
+  -o-transform: translate(-50%, -50%);
+  transform: translate(-50%, -50%);
+  overflow: hidden;
+}
+
+.iv-snap-image {
+  position: relative;
+}
+
+.iv-snap-handle {
+  position: absolute;
+  border: 1px solid #ccc;
+  -webkit-transform: translate3d(0, 0, 0);
+  -moz-transform: translate3d(0, 0, 0);
+  -ms-transform: translate3d(0, 0, 0);
+  -o-transform: translate3d(0, 0, 0);
+  transform: translate3d(0, 0, 0);
+  -webkit-box-shadow: 0px 0px 0px 200px rgba(0, 0, 0, 0.5);
+  -moz-box-shadow: 0px 0px 0px 200px rgba(0, 0, 0, 0.5);
+  box-shadow: 0px 0px 0px 200px rgba(0, 0, 0, 0.5);
+}
+
+/*** zoom slider ***/
+.iv-zoom-slider {
+  width: 100%;
+  -webkit-box-sizing: content-box;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+  border: 1px solid #666;
+  border-top: 0;
+  background: rgba(204, 204, 204, 0.1);
+  height: 15px;
+  position: absolute;
+  top: 150px;
+  left: -1px;
+}
+
+.iv-zoom-handle {
+  width: 20px;
+  height: 15px;
+  background: #ccc;
+  position: absolute;
+}
+
+/ snap view css end */
+.iv-image-view {
+  position: absolute;
+  height: 100%;
+  width: 100%;
+}
+
+.iv-image-wrap {
+  display: inline-block;
+}
+
+.iv-image-wrap:active {
+  cursor: move;
+}
+
+.iv-large-image {
+  max-width: 10

[pgadmin-hackers] Re: [pgAdmin 4 - Bug #1292] ERROR: template database "!@#$%^&*()_+{}|:"<>?=-\\][';/.," does not exist message throws if template database contain special charterers

2016-06-06 Thread Sanket Mehta
Hi,

I have resolved the issue and patch is attached with this mail.
Please review it and let me know in case any issues.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Jun 6, 2016 at 4:23 PM, <redm...@postgresql.org> wrote:

> Issue #1292 has been updated by Sanket Mehta.
>
>- *Assignee* set to *Sanket Mehta*
>
> --
> Bug #1292: ERROR: template database "!@#$%^&*()_+{}|:"<>?=-\\][';/.," does
> not exist message throws if template database contain special charterers
> <https://redmine.postgresql.org/issues/1292#change-2501>
>
>- Author: Fahar Abbas
>    - Status: In Progress
>- Priority: Normal
>- Assignee: Sanket Mehta
>- Category:
>- Target version: 1.0 Beta 1
>
> Commit ID:
> ---
> commit 954163b4957c1dce89c0632d009b845cbe90faf4
>
> Browser version:
> 
> Firefox 45.0.2
>
> Python version:
> 
> 3.5.1+
>
> Platforms:
> All
>
> ERROR: template database "!@#$%^&*()_+{}|:"<>?=-\\][';/.," does not exist
> message throws if user try to create database with template database that
> name contain special charterers.
>
> Please note that this issue is not reproducible in other template
> databases that name is simple one.
>
> Please note that this is not reproduce in pgAdmin3.
>
> Steps:
>
> 1. Install pgAdmin4 on Ubuntu 16.04
> 2. Install PG-9.6-beta 1 installer
> 3. Expand database node
> 4. give it's name !#$%^&*()_+{}|:"<>?=-\][';/.,
> 5. Database created successfully
> 6. Again create new database and give it's name abcd
> 7. Click on definition tab
> 8. select template database !#$%^&*()_+{}|:"<>?=-\][';/.,
> 9. Click on Save button
> Files Screen Shot 2016-06-02 at 10.25.34 am.png
> <https://redmine.postgresql.org/attachments/download/1197/Screen%20Shot%202016-06-02%20at%2010.25.34%20am.png>
> (1020 KB)
> Screen Shot 2016-06-02 at 10.26.01 am.png
> <https://redmine.postgresql.org/attachments/download/1198/Screen%20Shot%202016-06-02%20at%2010.26.01%20am.png>
> (1.03 MB)
> --
>
> You have received this notification because you have either subscribed to
> it, or are involved in it.
> To change your notification preferences, please click here:
> https://redmine.postgresql.org/my/account
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
index 5084d88..261e3d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
@@ -447,6 +447,24 @@ class DatabaseView(PGChildNodeView):
 )
 )
 try:
+# Fetch template name from oid is specified
+if 'template' in data:
+SQL = render_template(
+"/".join([self.template_path,'properties.sql']),
+did=data['template'], conn=self.conn
+)
+
+status, res = self.conn.execute_dict(SQL)
+if not status:
+return internal_server_error(errormsg=status)
+
+if len(res['rows']) == 0:
+return gone(
+_("Could not find the database on the server.")
+)
+
+data['template'] = res['rows'][0]['name']
+
 # The below SQL will execute CREATE DDL only
 SQL = render_template(
 "/".join([self.template_path, 'create.sql']),
@@ -709,6 +727,24 @@ class DatabaseView(PGChildNodeView):
 data[aclcol], allowedacl['acl']
 )
 
+# Fetch template name from oid is specified
+if 'template' in data:
+SQL = render_template(
+"/".join([self.template_path, 'properties.sql']),
+did=data['template'], conn=self.conn
+)
+
+status, res = self.conn.execute_dict(SQL)
+if not status:
+return internal_server_error(errormsg=status)
+
+if len(res['rows']) == 0:
+return gone(
+_("Could not find the database on the server.")
+)
+
+data['template'] = res['rows'][0]['name']
+
 SQL = render_template(
 "/".join([self.template_path, 'create.sql']),
 data=data, conn=self.conn
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
index 8441b0c..34b9ed7 100644
--- a/

[pgadmin-hackers] [pgadmin4][PATCH][PATCH]: RM 1113: casts should be alphabetical order

2016-05-27 Thread Sanket Mehta
Hi,

Please find the patch for pgadmin4 RM 1113 attached with this mail.
Please review it and commit.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/sql/9.1_plus/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/sql/9.1_plus/nodes.sql
index 87f331f..8e9f3e9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/sql/9.1_plus/nodes.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/sql/9.1_plus/nodes.sql
@@ -20,4 +20,5 @@
 WHERE
 {% endif %}
 ca.oid > {{datlastsysoid}}::OID
-{% endif %}
\ No newline at end of file
+{% endif %}
+ORDER BY st.typname, tt.typname
\ No newline at end of file

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


Re: [pgadmin-hackers] PATCH: graphical explain

2016-05-27 Thread Sanket Mehta
Hi,

I will start working on it once I will complete PEM 6.0.1 issues.
Now there is only 1 issue remaining in that bucket which I am currently
working on

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, May 27, 2016 at 4:44 PM, Dave Page <dp...@pgadmin.org> wrote:

> What is the status of this Sanket? I'd really like to see it completed
> before alpha.
>
> On Thu, Apr 21, 2016 at 3:07 PM, Dave Page <dp...@pgadmin.org> wrote:
> > This looks awesome, and is MIT licenced:
> >
> >
> http://www.jqueryrain.com/2016/01/imageviewer-jquery-zooming-and-panning-plugin/
> >
> >
> > On Wednesday, April 20, 2016, Sanket Mehta <
> sanket.me...@enterprisedb.com>
> > wrote:
> >>
> >>
> >> On Wed, Apr 20, 2016 at 6:12 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>>
> >>>
> >>>
> >>> On Tuesday, April 19, 2016, Sanket Mehta <
> sanket.me...@enterprisedb.com>
> >>> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> On Mon, Apr 18, 2016 at 5:38 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Monday, April 18, 2016, Sanket Mehta <
> sanket.me...@enterprisedb.com>
> >>>>> wrote:
> >>>>>>
> >>>>>> Hi Dave,
> >>>>>>
> >>>>>> Regarding your second comment,
> >>>>>> Almost all the libraries that I have checked uses Jquery UI which is
> >>>>>> quite heavy.
> >>>>>> Please share your comments about using these libraries.
> >>>>>
> >>>>>
> >>>>> What have you found?
> >>>>
> >>>> Below are the libraries I have checked out which uses JQUERY UI.
> >>>>
> >>>>  -
> https://github.com/princejwesley/minimap/blob/master/src/minimap.js
> >>>
> >>>
> >>> That one would work wound't it? Assuming it can do x and y movement.
> >>
> >> I have tried to implement the same but it is not working properly as
> >> scrolling in minimap was not there and sometimes it was not showing the
> map
> >> itself.
> >>
> >>>
> >>>
> >>> --
> >>> 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
>


Re: [pgadmin-hackers] PATCH: FTS configuration node

2016-05-18 Thread Sanket Mehta
On Wed, May 18, 2016 at 12:42 PM, Ashesh Vashi <
ashesh.va...@enterprisedb.com> wrote:

> On Wed, May 18, 2016 at 12:41 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA the revised patch.
>> Response is lnline.
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Tue, May 17, 2016 at 12:54 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi Sanket,
>>>
>>> Please find my review comments below:
>>>
>>> 1. In create mode it generates wrong sql.
>>>
>>> CREATE TEXT SEARCH CONFIGURATION test.asdf (
>>> COPY=
>>> );
>>>
>>> steps to reproduce:
>>> a] Fill up any necessary fields in general tab.
>>> b] On definition tab set Copy config filed and navigate to SQL tab.
>>> c] Come back again to definition tab clear Copy config field and set
>>> Parser field and again navigate to SQL tab
>>>
>> Fixed
>>
>>>
>>> 2. Create new FTS configuration with parser throws below error.
>>>
>>> provide atleast copy config or parser.
>>>
>>> (this is because you have used key name for parser in js as "prsname"
>>> and in python you have applied validations on key "parser")
>>>
>> Fixed
>>
>>>
>>> 3. When we clear dictionary for any token using cross (x) button in
>>> select2; JavaScript code for selecct2 fails. (see attached screenshot)
>>>
>> This occurs due to issue in select2 control. Its a generalized issue
>> which will be resolved later.
>>
> When you say - it is common issue, can you please point where else you've
> seen this behaviour?
>
The same behaviour occurs in all nodes where multiselect cell is being used
like, exclusion control, debugger etc.

>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> <http://www.enterprisedb.com/>
>
>
> *http://www.linkedin.com/in/asheshvashi*
> <http://www.linkedin.com/in/asheshvashi>
>
>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Software Engineer *
>>>
>>>
>>>
>>> EenterpriseDB <http://www.enterprisedb.com>
>>>
>>> On Mon, May 16, 2016 at 7:37 PM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Revised patch is attached with this mail.
>>>> My response is inline.
>>>>
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>> On Fri, May 13, 2016 at 6:20 PM, Akshay Joshi <
>>>> akshay.jo...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Sanket
>>>>>
>>>>> Below are my review comments:
>>>>>
>>>>>
>>>>>- Add button should be disabled in Tokens tab while creating.
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- Unable to click on down arrow for token select control.
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- Title should be change from "Create FTS-dictionaries" to "Create
>>>>>FTS-Configuration".
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- Tree node is not getting refreshed on name change.
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- Unable to rename FTS Configuration when name contains any
>>>>>capital letter.
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- If user tries to add already existing token then respective row
>>>>>in the backgrid should be highlighted.
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- "URL not found" when click on SQL help icon from the properties
>>>>>dialog.
>>>>>
>>>>> Done
>>>>
>>>>>
>>>>>- SQL should not be generated when remove and add the same token
>>>>>again. Currently it is creating two sql's one for remove and
>>>>>another is for add.
>

Re: [pgadmin-hackers] PATCH: FTS configuration node

2016-05-18 Thread Sanket Mehta
Hi,

PFA the revised patch.
Response is lnline.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, May 17, 2016 at 12:54 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi Sanket,
>
> Please find my review comments below:
>
> 1. In create mode it generates wrong sql.
>
> CREATE TEXT SEARCH CONFIGURATION test.asdf (
> COPY=
> );
>
> steps to reproduce:
> a] Fill up any necessary fields in general tab.
> b] On definition tab set Copy config filed and navigate to SQL tab.
> c] Come back again to definition tab clear Copy config field and set
> Parser field and again navigate to SQL tab
>
Fixed

>
> 2. Create new FTS configuration with parser throws below error.
>
> provide atleast copy config or parser.
>
> (this is because you have used key name for parser in js as "prsname" and
> in python you have applied validations on key "parser")
>
Fixed

>
> 3. When we clear dictionary for any token using cross (x) button in
> select2; JavaScript code for selecct2 fails. (see attached screenshot)
>
This occurs due to issue in select2 control. Its a generalized issue which
will be resolved later.

>
>
>
>
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB <http://www.enterprisedb.com>
>
> On Mon, May 16, 2016 at 7:37 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Revised patch is attached with this mail.
>> My response is inline.
>>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Fri, May 13, 2016 at 6:20 PM, Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Sanket
>>>
>>> Below are my review comments:
>>>
>>>
>>>- Add button should be disabled in Tokens tab while creating.
>>>
>>> Done
>>
>>>
>>>- Unable to click on down arrow for token select control.
>>>
>>> Done
>>
>>>
>>>- Title should be change from "Create FTS-dictionaries" to "Create
>>>FTS-Configuration".
>>>
>>> Done
>>
>>>
>>>- Tree node is not getting refreshed on name change.
>>>
>>> Done
>>
>>>
>>>- Unable to rename FTS Configuration when name contains any capital
>>>letter.
>>>
>>> Done
>>
>>>
>>>- If user tries to add already existing token then respective row in
>>>the backgrid should be highlighted.
>>>
>>> Done
>>
>>>
>>>- "URL not found" when click on SQL help icon from the properties
>>>dialog.
>>>
>>> Done
>>
>>>
>>>- SQL should not be generated when remove and add the same token
>>>    again. Currently it is creating two sql's one for remove and another
>>>is for add.
>>>   - *Fix for the above issue is*: - Add "keys: ['token']," to
>>>   TokenModel in your js file.
>>>
>>> Done
>>
>>
>>>
>>> On Fri, May 13, 2016 at 2:58 PM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Last patch for FTS configuration does not contain node.ui.js file
>>>> Kindly ignore it.
>>>>
>>>> Here is the new revised patch attached with this mail.
>>>> Please do review it and let me know if any changes required
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>> On Thu, May 12, 2016 at 4:38 PM, Sanket Mehta <
>>>> sanket.me...@enterprisedb.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> PFA the revised patch.
>>>>> Please do review it and let me know if anything is not proper.
>>>>>
>>>>> Regards,
>>>>> Sanket Mehta
>>>>> Sr Software engineer
>>>>> Enterprisedb
>>>>>
>>>>> On Thu, May 5, 2016 at 8:19 PM, Harshal Dhumal <
>>>>> harshal.dhu...@enterprisedb.com> wrote:
>>>>>
>>>>>> + patch link
>>>>>>
>>>>>>
>>>>>> http://www.postgresql.org/message-id/CAFiP3vwkka+=1foj7kr2zbc4azecoca9eo9dz34-oyy_9ge...@mail.gmail.com
>>>>>>
&g

Re: [pgadmin-hackers] [PATCH] Tables node (pgAdmin4)

2016-05-17 Thread Sanket Mehta
traint creation:

   - Access method should not be allowed to be empty. (currently by
   clicking 'x' will remove the selection in it)

Index creation:

   - No error message for name field when empty
   - No error message when column name is not provided while adding a
   column in index
   - While adding a column if no name is provided, "None" appears in SQL
   tab which will give error on OK button click
   - when comment is provided while creation, it gives error saying index
   does not exists. because schema name is not added before it.

Rule creation:

   - Name is empty error does not come till user enters something in
   definition tab
   - DO INSTEAD button does not make any difference to SQL (it works in
   edit mode)

Rule edit mode:

   - Add comment in edit mode, check the SQL in sql tab. Now come back to
   general tab and removes comment and check the sql tab again.
   SQL for comment is still there with empty string as comment

Trigger Creation:

   - SQL is not proper when creating a trigger. "()" should be appended to
   function name in SQL.
   It gives error while creating a trigger
   - "+" sign is visible in browser tree in front of trigger.  either On
   expanding trigger, it should show the trigger function name or that "+"
   sign should not appear

Trigger edit node:

   - On removing comment, nothing happens. No sql is being created. Comment
   is still there in properties.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, May 16, 2016 at 7:02 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA add-on patch for table and it's child node. (please apply this patch
> on version 6 patch)
>
> Murtuza and I fixed following issues:
>
> 1. SQL formatting
> 2. Vacuum grid should not be editable in properties mode.
> 3. Column datatype does not get displayed in the properties and edit mode.
> 4. Do not allow to add another primary key if one already exist.
>
> And another minor enhancements.
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB <http://www.enterprisedb.com>
>
> On Sat, May 14, 2016 at 2:03 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>>
>> Hi,
>>
>>
>> PFA updated patches (version: 6) for table and it's child nodes.
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB <http://www.enterprisedb.com>
>>
>> On Fri, May 13, 2016 at 6:55 PM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Review Comments:
>>>
>>> - Please replace 'can not' with 'cannot'  in all the validation messages.
>>> - PG 9.1+ Inheritance issue as below:
>>>
>>> CREATE TABLE public.table1
>>> (
>>> )
>>> (
>>> )
>>> INHERITS (a)
>>> WITH (
>>> OIDS = FALSE
>>> )
>>> TABLESPACE pg_default;
>>> ALTER TABLE public.table1
>>> OWNER to postgres;
>>>
>>>
>>> brackets are coming twice.
>>>
>> Fixed
>>
>>
>>>
>>> - Please maintain one line spacing between SQL queries In the SQL Tab.
>>>
>> TODO
>>
>>
>>> - Foreign Key Grid in Table css issue: Grid columns expands on the
>>> selection of the cell
>>>
>> Fixed
>>
>>
>>> - Check Constraint: Validated? option should be True by default
>>>
>> Not sure about this. I cross checked in pgadmin3.
>>
>>
>>
>>> - pg 9.4: Exclude constraint does not render in SQL tab
>>>
>> Fixed
>>
>>
>>> - Missing Security validation
>>>
>> Fixed
>>
>>
>>> - Vacuum grid should not be editable in properties mode.
>>>
>> TODO (It's editable but one cannot save it on server from here as there
>> is no save button.)
>>
>>
>>> - Edit mode, Fill Factor can be allowed to be null.
>>>
>> TODO (This is generic issue in Integer and Numeric controls. This issue
>> is covered in this partial patch
>> <http://www.postgresql.org/message-id/cafip3vzvtqxjmpzeeav4pd0p7cevcrrdfgdwuvu4cyhnthp...@mail.gmail.com>
>> )
>>
>>
>>> - While dropping inheritance, related table columns drop SQL are also
>>> populated in the SQL Tab
>>>
>>> ALTER TABLE public."Tbl"
>>> NO INHERIT b;
>>> ALTER TABLE public."Tbl" DROP COLUMN id;
>>> ALTER TABLE public."Tbl" DROP COLUMN name;
>>>
>>>
>> Fixed
>

Re: [pgadmin-hackers] PATCH: FTS configuration node

2016-05-16 Thread Sanket Mehta
Hi,

Revised patch is attached with this mail.
My response is inline.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, May 13, 2016 at 6:20 PM, Akshay Joshi <akshay.jo...@enterprisedb.com
> wrote:

> Hi Sanket
>
> Below are my review comments:
>
>
>- Add button should be disabled in Tokens tab while creating.
>
> Done

>
>- Unable to click on down arrow for token select control.
>
> Done

>
>- Title should be change from "Create FTS-dictionaries" to "Create FTS
>-Configuration".
>
> Done

>
>- Tree node is not getting refreshed on name change.
>
> Done

>
>- Unable to rename FTS Configuration when name contains any capital
>letter.
>
> Done

>
>- If user tries to add already existing token then respective row in
>the backgrid should be highlighted.
>
> Done

>
>- "URL not found" when click on SQL help icon from the properties
>dialog.
>
> Done

>
>- SQL should not be generated when remove and add the same token
>again. Currently it is creating two sql's one for remove and another
>is for add.
>   - *Fix for the above issue is*: - Add "keys: ['token']," to
>   TokenModel in your js file.
>
> Done


>
> On Fri, May 13, 2016 at 2:58 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi All,
>>
>> Last patch for FTS configuration does not contain node.ui.js file
>> Kindly ignore it.
>>
>> Here is the new revised patch attached with this mail.
>> Please do review it and let me know if any changes required
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Thu, May 12, 2016 at 4:38 PM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA the revised patch.
>>> Please do review it and let me know if anything is not proper.
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Thu, May 5, 2016 at 8:19 PM, Harshal Dhumal <
>>> harshal.dhu...@enterprisedb.com> wrote:
>>>
>>>> + patch link
>>>>
>>>>
>>>> http://www.postgresql.org/message-id/CAFiP3vwkka+=1foj7kr2zbc4azecoca9eo9dz34-oyy_9ge...@mail.gmail.com
>>>>
>>>> --
>>>> *Harshal Dhumal*
>>>> *Software Engineer *
>>>>
>>>>
>>>>
>>>> EenterpriseDB <http://www.enterprisedb.com>
>>>>
>>>> On Thu, May 5, 2016 at 8:18 PM, Sanket Mehta <
>>>> sanket.me...@enterprisedb.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> PFA first patch for FTS configuration node.
>>>>>
>>>>> It depends upon backgrid select2cell multi select control, for which
>>>>> Harshal has sent the patch recently.
>>>>> Please do apply his patch first and then apply this patch.
>>>>>
>>>>> Please do review it and let me know if any changes are required.
>>>>>
>>>>>
>>>>> Regards,
>>>>> Sanket Mehta
>>>>> Sr Software engineer
>>>>> Enterprisedb
>>>>>
>>>>>
>>>>> --
>>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>>>> To make changes to your subscription:
>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>
>>>>>
>>>>
>>>
>>
>>
>> --
>> 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*
>
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
new file mode 100644
index 000..17130fe
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py
@@ -0,0 +1,951 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+

Re: [pgadmin-hackers] PATCH: Graphincal explain integrated in sql editor

2016-05-13 Thread Sanket Mehta
Hi,

Apart from resolving all the issues mentioned in previous mail, All the
explain options and auto rollback/auto commit are also added to preferences
dialog.
Any change to explains options or auto-rollback/auto-commit in sql editor
will directly reflect its corresponding option in preference dialog.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, May 13, 2016 at 3:55 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi,
>
> Revised patch is attached
> Response in inline.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Tue, May 10, 2016 at 2:54 PM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Sanket
>>
>> On Tue, May 10, 2016 at 12:21 PM, Sanket Mehta <sanket.mehta@enterprisedb
>> .com> wrote:
>>
>>> Hi,
>>>
>>> As previous patch was not applicable to latest pgadmin4 source code,
>>> here is the new patch accommodating latest code.
>>> Please do review it and send comments.
>>>
>>
>> Following is my review comments
>>
>>- Remove Demo and sample code which you have used for testing before
>>integration.
>>
>> Fixes
>
>>
>>- Facing issue to open QueryTool as there is some problem in require
>>module.
>>
>> Fixed
>
>>
>>- Please add 'codemirror/addon/fold/foldgutter', 
>> 'codemirror/addon/fold/foldcode',
>>'codemirror/addon/fold/pgadmin-sqlfoldcode' files which has been
>>removed from your patch.
>>
>> Fixed
>
>>
>>- Remove below code from sqleditor.js which is duplicated in _execute
>>function
>>-
>>   - self.trigger(
>>   -'pgadmin-sqleditor:loading-icon:show',
>>   - '{{ _('Initializing the query execution!') }}'
>>   -   )
>>
>> Fixed
>
>>
>>- Clear the existing contents of the Explain tab when execute the
>>query without explain.
>>
>> Fixed
>
>>
>>- If schema name is exists then please prefix the schema name to the
>>node.
>>
>> Fixed
>
>>
>>- Please check the data is available before working on it in sqleditor
>>.js at line no 1043 inside _render().  In case of "View Data" it
>>throws an error.
>>
>> Fixed
>
>>
>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Mon, May 9, 2016 at 11:56 PM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Please ignore previous patch as there was an error in it.
>>>>
>>>> Error:
>>>> Tooltip was not getting disappear when user moves cursor out of image.
>>>>
>>>> I have attached a proper patch with this mail.
>>>> Please consider it for testing.
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>> On Mon, May 9, 2016 at 8:49 PM, Sanket Mehta <
>>>> sanket.me...@enterprisedb.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> PFA revised patch according to Ashesh's comments.
>>>>> Please find my response inline.
>>>>>
>>>>> I am currently adding minimap feature in graphical explain.
>>>>> I will send a new patch for the same.
>>>>>
>>>>> Regards,
>>>>> Sanket Mehta
>>>>> Sr Software engineer
>>>>> Enterprisedb
>>>>>
>>>>> On Mon, Apr 25, 2016 at 4:36 PM, Ashesh Vashi <
>>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi Sanket,
>>>>>>
>>>>>> Please find the review comments.
>>>>>> - Please add the missing 'explain.css'.
>>>>>>
>>>>> Done
>>>>>
>>>>>> - The application should be smart enough to handle conflict in
>>>>>> options.
>>>>>>i.e.
>>>>>>Buffer is not a valid options without EXPLAIN ANALYZE.
>>>>>>
>>>>> Done
>>>>>
>>>>>> - A statement having EXPLAIN keywords with different format should at
>>>>>> least render the output in the data-grid.
>>>>>>   i.e. EXPLAIN (FORMAT xml) SELE

Re: [pgadmin-hackers] PATCH: FTS configuration node

2016-05-13 Thread Sanket Mehta
Hi All,

Last patch for FTS configuration does not contain node.ui.js file
Kindly ignore it.

Here is the new revised patch attached with this mail.
Please do review it and let me know if any changes required

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, May 12, 2016 at 4:38 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi,
>
> PFA the revised patch.
> Please do review it and let me know if anything is not proper.
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Thu, May 5, 2016 at 8:19 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> + patch link
>>
>>
>> http://www.postgresql.org/message-id/CAFiP3vwkka+=1foj7kr2zbc4azecoca9eo9dz34-oyy_9ge...@mail.gmail.com
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB <http://www.enterprisedb.com>
>>
>> On Thu, May 5, 2016 at 8:18 PM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA first patch for FTS configuration node.
>>>
>>> It depends upon backgrid select2cell multi select control, for which
>>> Harshal has sent the patch recently.
>>> Please do apply his patch first and then apply this patch.
>>>
>>> Please do review it and let me know if any changes are required.
>>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>>
>>> --
>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>
>>>
>>
>
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
new file mode 100644
index 000..fa2d3e6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py
@@ -0,0 +1,937 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Configuration node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext as _
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error, gone
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils \
+import SchemaChildModule
+from pgadmin.browser.server_groups.servers.databases import DatabaseModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsConfigurationModule(SchemaChildModule):
+"""
+ class FtsConfigurationModule(SchemaChildModule)
+
+A module class for FTS Configuration node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsConfigurationModule and
+it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node
+
+* script_load()
+  - Load the module script for FTS Configuration, when any of the schema
+  node is initialized.
+"""
+NODE_TYPE = 'fts_configuration'
+COLLECTION_LABEL = _('FTS Configurations')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+self.manager = None
+super(FtsConfigurationModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+  

Re: [pgadmin-hackers] PATCH: FTS configuration node

2016-05-12 Thread Sanket Mehta
Hi,

PFA the revised patch.
Please do review it and let me know if anything is not proper.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, May 5, 2016 at 8:19 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> + patch link
>
>
> http://www.postgresql.org/message-id/CAFiP3vwkka+=1foj7kr2zbc4azecoca9eo9dz34-oyy_9ge...@mail.gmail.com
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB <http://www.enterprisedb.com>
>
> On Thu, May 5, 2016 at 8:18 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA first patch for FTS configuration node.
>>
>> It depends upon backgrid select2cell multi select control, for which
>> Harshal has sent the patch recently.
>> Please do apply his patch first and then apply this patch.
>>
>> Please do review it and let me know if any changes are required.
>>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
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
new file mode 100644
index 000..fa2d3e6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py
@@ -0,0 +1,937 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Configuration node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext as _
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error, gone
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils \
+import SchemaChildModule
+from pgadmin.browser.server_groups.servers.databases import DatabaseModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsConfigurationModule(SchemaChildModule):
+"""
+ class FtsConfigurationModule(SchemaChildModule)
+
+A module class for FTS Configuration node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsConfigurationModule and
+it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node
+
+* script_load()
+  - Load the module script for FTS Configuration, when any of the schema
+  node is initialized.
+"""
+NODE_TYPE = 'fts_configuration'
+COLLECTION_LABEL = _('FTS Configurations')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+self.manager = None
+super(FtsConfigurationModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema
+node is initialized.
+"""
+return DatabaseModule.NODE_TYPE
+
+
+blueprint = FtsConfigurationModule(__name__)
+
+
+class FtsConfigurationView(PGChildNodeView):
+"""
+class FtsConfigurationView(PGChildNodeView)
+
+A view class for FTS Configuration node derived from PGChildNodeView.
+This class is responsible for all the stuff related to view like
+create/update/delete FTS Configurati

[pgadmin-hackers] PATCH: minor typo in fts dictionary node

2016-05-09 Thread Sanket Mehta
Hi,

PFA the patch for minor typo issue in fts dictionary node.
Please do review it and commit if found proper.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/nodes.sql
index 78abd0b..272c23c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/nodes.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/nodes.sql
@@ -1,4 +1,4 @@
-{# FETCH FTS DICTIONARY name statement #}
+{# FETCH FTS DICTIONARY NAME statement #}
 SELECT
 oid, dictname as name
 FROM
@@ -7,7 +7,7 @@ WHERE
 {% if scid %}
 dict.dictnamespace = {{scid}}::OID
 {% elif dcid %}
-dict.oid = {{pid}}::OID
+dict.oid = {{dcid}}::OID
 {% endif %}
 
 ORDER BY name
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/sql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/sql.sql
index 42537f6..6a36829 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/sql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/sql/9.1_plus/sql.sql
@@ -16,7 +16,7 @@ FROM
 E'\n);' ||
 CASE
 WHEN description IS NOT NULL THEN
-E'\n\nCOMMENT ON TEXT SEARCH TEMPLATE ' || nspname || E'.' || dict.dictname ||
+E'\n\nCOMMENT ON TEXT SEARCH DICTIONARY ' || nspname || E'.' || dict.dictname ||
 E' IS ' || pg_catalog.quote_literal(description) || E';'
 ELSE ''  END as sql
 FROM

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


Re: [pgadmin-hackers] New committer: Akshay Joshi

2016-05-06 Thread Sanket Mehta
Congratulations Akshay...way to go...!!!

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, May 6, 2016 at 2:25 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Congrats Akshay... Well deserved... keep it up
>
> Thanks
> Surinder Kumar
>
> On Fri, May 6, 2016 at 2:01 PM, Neel Patel <neel.pa...@enterprisedb.com>
> wrote:
>
>> Congratulations Akshay... Well deserved... !!
>>
>> Thanks,
>> Neel Patel
>>
>> On Fri, May 6, 2016 at 1:58 PM, Guillaume Lelarge <guilla...@lelarge.info
>> > wrote:
>>
>>> Le 6 mai 2016 10:25 AM, "Dave Page" <dp...@pgadmin.org> a écrit :
>>> >
>>> > All,
>>> >
>>> > I'm pleased to announce that Akshay Joshi has been added to the
>>> > pgAdmin 4 project as our newest committer. Akshay has been working on
>>> > pgAdmin 3 for a number of years now, and has done some excellent work
>>> > on pgAdmin 4, being primarily responsible for the Query Tool amongst
>>> > other work.
>>> >
>>> > Congratulations Akshay!
>>> >
>>>
>>> Congrats Akshay! That's well deserved.
>>>
>>
>>
>


Re: [pgadmin-hackers] PATCH: Graphincal explain integrated in sql editor

2016-04-25 Thread Sanket Mehta
Hi,

This patch includes the patch sent earlier for stand alone graphical
explain.

And also "horizontal lines are not proper" bug is fixed in the same which
was reported by Dave in previous patch.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Apr 21, 2016 at 8:38 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi Team,
>
> PFA the first patch for graphical explain integrated in sql editor.
>
> Below are the few things which are different from previous patch which was
> sent for stand alone graphical explain.
>
>  -  Now user can select Explain/Explain Analyze with four optional
> properties (Verbose, costs, timing and buffers)
>
>  - Initially graph will be scale (according to only its width not height)
> to fit to screen so no blank space will be there in case of very large
> graph.
>
> - Along with zoom in/out button, "zoom to original" button is also
> provided, by clicking on which graph will be scale to its original size
> (not same as initial one which is according to screen size).
>
> Please do review this patch and let me know in case you have any comments.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>


[pgadmin-hackers] PATCH: resolving issue in casts as functions are not being fetched due to change in node.ui.js

2016-04-22 Thread Sanket Mehta
Hi,

Due to commit id 944bdbb96c3b360c856d7586144b835e44afac43 in node.ui.js,
functions were not being fetched after selecting source and target types as
I have overridden the options property for functions select control.

I have resolved that issue and patch is attached with this mail.

Please do review it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js
index 690a6d5..0010222 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js
@@ -177,20 +177,19 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
 type: 'text', disabled: function(m) { return !m.isNew(); },
 group: 'Definition', mode: ['create'],
 control: 'node-ajax-options',
-options: function() {
-
-  var srcTyp = this.model.get('srctyp');
-  var trgtyp = this.model.get('trgtyp');
+options: function(control) {
+  var srcTyp = control.model.get('srctyp');
+  var trgtyp = control.model.get('trgtyp');
   var res = [];
 
   if(srcTyp != undefined && srcTyp != '' &&
  trgtyp != undefined && trgtyp != '')
   {
- var node = this.field.get('schema_node'),
+ var node = control.field.get('schema_node'),
  _url = node.generate_url.apply(
  node, [
-   null, 'get_functions', this.field.get('node_data'), false,
-   this.field.get('node_info')
+   null, 'get_functions', control.field.get('node_data'), false,
+   control.field.get('node_info')
  ]);
  $.ajax({
  type: 'POST',

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


Re: [pgadmin-hackers] PATCH: graphical explain

2016-04-20 Thread Sanket Mehta
On Wed, Apr 20, 2016 at 6:12 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Tuesday, April 19, 2016, Sanket Mehta <sanket.me...@enterprisedb.com>
> wrote:
>
>> Hi,
>>
>> On Mon, Apr 18, 2016 at 5:38 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Monday, April 18, 2016, Sanket Mehta <sanket.me...@enterprisedb.com>
>>> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> Regarding your second comment,
>>>> Almost all the libraries that I have checked uses Jquery UI which is
>>>> quite heavy.
>>>> Please share your comments about using these libraries.
>>>>
>>>
>>> What have you found?
>>>
>> Below are the libraries I have checked out which uses JQUERY UI.
>>
>>  - https://github.com/princejwesley/minimap/blob/master/src/minimap.js
>>
>
> That one would work wound't it? Assuming it can do x and y movement.
>
I have tried to implement the same but it is not working properly as
scrolling in minimap was not there and sometimes it was not showing the map
itself.


>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


Re: [pgadmin-hackers] PATCH: graphical explain

2016-04-19 Thread Sanket Mehta
Hi,

On Mon, Apr 18, 2016 at 5:38 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Monday, April 18, 2016, Sanket Mehta <sanket.me...@enterprisedb.com>
> wrote:
>
>> Hi Dave,
>>
>> Regarding your second comment,
>> Almost all the libraries that I have checked uses Jquery UI which is
>> quite heavy.
>> Please share your comments about using these libraries.
>>
>
> What have you found?
>
Below are the libraries I have checked out which uses JQUERY UI.

 - https://github.com/princejwesley/minimap/blob/master/src/minimap.js

 - https://github.com/samcroft/mini-map (alpha release only)

 -
http://www.jqueryscript.net/text/Sublime-Text-Like-Web-Page-Minimap-Plugin-For-jQuery.html

 -
http://www.jqueryscript.net/other/jQuery-Plugin-To-Create-A-Flexible-Web-Page-Minimap-minimap-js.html

 - https://github.com/goldenapples/jquery.minimap

 - https://www.mapbox.com/mapbox.js/example/v1.0.0/leaflet-minimap/ (not
free)

 - http://codepen.io/billdwhite/pen/lCAdi (depends upon d3 library)

 - http://blog.urvatechlabs.com/minimap-jquery-plugin/

 - http://jsfiddle.net/ARTsinn/gbSSw/

 - http://jsfiddle.net/danimt/ARVWA/ (depends upon L library)

 - http://atom-minimap.github.io/minimap/

 - http://js-tutorial.com/minimap-a-preview-of-the-full-web-page-1334

Some of them uses or depends upon different libraries (mentioned besides
the link)


>
>>
>>
>> Meanwhile currently I have implemented zoom in/out functionality in
>> graphical explain.
>> I have added two buttons on left top corner of panel (see the attached
>> screen shot),
>> which you can use to zoom in/out the graph.
>>
>> Please do review it and let me know your comments about them.
>>
>
> I have tested the code, so no screenshots necessary :-).
>
> The problem with the zoom is that it doesn't give you any visual
> indicators that there is something on the canvas. With a big plan, it'll
> just look blank, unless the user starts scrolling/zooming. The viewport
> will give instant hints to the user that there's a big plan there, albeit
> out of view, and allow them to very easily navigate it.
>
>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Wed, Apr 13, 2016 at 2:23 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi,
>>>
>>> A couple of comments following a quick test:
>>>
>>> 1) Some of the horizontal lines are not actually horizontal - they
>>> noticeably drop down. Please see the attached screenshot.
>>>
>>> 2) I thought we were going to use a "viewport" to allow the user to
>>> navigate through the diagram? I was thinking of displaying a thumbnail
>>> with viewport in the top-left, with the main view being synchronised
>>> to the viewport position/zoom level - for example, look at the 2D Zoom
>>> example on http://www.ajax-zoom.com/. Something like Croppie might
>>> help: http://foliotek.github.io/Croppie/ (as ajax-zoom is not free).
>>>
>>> On Tue, Apr 12, 2016 at 11:36 AM, Sanket Mehta
>>> <sanket.me...@enterprisedb.com> wrote:
>>> > Hi,
>>> >
>>> > Please do ignore previous patch as it contains trailing whitespaces.
>>> > PFA the revised patch after resolving this issue.
>>> >
>>> >
>>> >
>>> > Regards,
>>> > Sanket Mehta
>>> > Sr Software engineer
>>> > Enterprisedb
>>> >
>>> > On Mon, Apr 11, 2016 at 10:04 PM, Sanket Mehta
>>> > <sanket.me...@enterprisedb.com> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> PFA the patch for graphical explain feature.
>>> >>
>>> >> It consists of explain.js, __init__.py and demo_explain.html,
>>> snap_svg.js
>>> >> and snap_svg-min.js file.
>>> >>
>>> >> Currently I have placed hard coded JSON data in demo_explain.html
>>> file to
>>> >> display graphical output; which will be replace by actual output user
>>> get
>>> >> from server in JSON format.
>>> >>
>>> >> Use below URL to access graphical output:
>>> >>
>>> >> http://localhost:5050/misc/explain where 5050 is the port your web
>>> server
>>> >> is running on
>>> >>
>>> >> To test the patch, user can replace plan data (stored in 'data'
>>> variable)
>>> >> in demo_explain.html with other valid plan data in JSON format and
>>> run the
>>> >> above URL.
>>> >>
>>> >> Please review the patch and provide comments for the same.
>>> >>
>>> >> TODO: Integration of graphical explain into sql editor
>>> >>
>>> >>
>>> >> Regards,
>>> >> Sanket Mehta
>>> >> Sr Software engineer
>>> >> Enterprisedb
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>> > To make changes to your subscription:
>>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>>> >
>>>
>>>
>>>
>>> --
>>> 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
>
>


Re: [pgadmin-hackers] PATCH: FTS Dictionary

2016-04-14 Thread Sanket Mehta
Thanks for reviewing it Dave.
I will resolve these issues ASAP.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Apr 15, 2016 at 1:27 AM, Dave Page <dp...@pgadmin.org> wrote:

> On Thu, Apr 14, 2016 at 3:41 PM, Sanket Mehta
> <sanket.me...@enterprisedb.com> wrote:
> > Hi,
> >
> > PFA patch for FTS Dictionaries.
> > Please do review it and let me know in case of any issues.
>
> Thanks - committed with a few cosmetic changes, and a couple of minor
> issues to resolve:
>
> 1) The template is not shown in properties views if it is not in a
> system schema (because of the way you are dealing with schema names
> etc). Please also check how the existing code will behave, if there is
> a template in the public schema with the same name as one in
> pg_catalog.
>
> 2) Please strip the quotes from the options before displaying them.
>
> I'll create a card for this.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgadmin-hackers] PATCH: Resolving issue regarding FTS Parser name

2016-04-14 Thread Sanket Mehta
Hi,

PFA the patch for resolving an issue related to FTS Parser name.

Steps to reproduce the issue:

 - create fts parser with name "user name"
- Expand fts parser
- Right Click and select properties
- Change name to "user name car"


it's give ERROR: syntax error at or near "name"
LINE 2: RENAME TO user name car;

Please do review the patch and send review comments if any.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/sql/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/sql/9.1_plus/update.sql
index ac29d99..2024410 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/sql/9.1_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/sql/9.1_plus/update.sql
@@ -2,7 +2,7 @@
 {% if data %}
 {% if data.name and data.name != o_data.name %}
 ALTER TEXT SEARCH PARSER {{conn|qtIdent(o_data.schema)}}.{{conn|qtIdent(o_data.name)}}
-RENAME TO {{data.name}};
+RENAME TO {{conn|qtIdent(data.name)}};
 {% endif %}
 
 {#in case of rename, use new fts template name #}

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


[pgadmin-hackers] PATCH: FTS Dictionary

2016-04-14 Thread Sanket Mehta
Hi,

PFA patch for FTS Dictionaries.
Please do review it and let me know in case of any issues.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py
new file mode 100644
index 000..3f7f278
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py
@@ -0,0 +1,818 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Dictionary node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext as _
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error, gone
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils \
+import SchemaChildModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsDictionaryModule(SchemaChildModule):
+"""
+ class FtsDictionaryModule(SchemaChildModule)
+
+A module class for FTS Dictionary node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsDictionaryModule and
+it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node
+
+* script_load()
+  - Load the module script for FTS Dictionary, when any of the schema
+  node is initialized.
+"""
+NODE_TYPE = 'fts_dictionary'
+COLLECTION_LABEL = _('FTS Dictionaries')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+self.manager = None
+super(FtsDictionaryModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema
+node is initialized.
+"""
+return schemas.SchemaModule.NODE_TYPE
+
+
+blueprint = FtsDictionaryModule(__name__)
+
+
+class FtsDictionaryView(PGChildNodeView):
+"""
+class FtsDictionaryView(PGChildNodeView)
+
+A view class for FTS Dictionary node derived from PGChildNodeView.
+This class is responsible for all the stuff related to view like
+create/update/delete FTS Dictionary,
+showing properties of node, showing sql in sql pane.
+
+Methods:
+---
+* __init__(**kwargs)
+  - Method is used to initialize the FtsDictionaryView and it's base view.
+
+* module_js()
+  - This property defines (if javascript) exists for this node.
+Override this property for your own logic
+
+* check_precondition()
+  - This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+
+* tokenize_options(self, option_value):
+-   This function will tokenize the string stored in database
+e.g. database store the value as below
+key1=value1, key2=value2, key3=value3, 
+This function will extract key and value from above string
+
+* list()
+  - This function is used to list all the  nodes within that collection.
+
+* nodes()
+  - This function will be used to create all the child node within collection.
+Here it will create all the FTS Dictionary nodes.
+
+* node()
+  - This function will be used to create a node given its oid
+Here it will create the FTS Template node based on its oid
+
+* properties(gid, sid, did, scid, dcid)
+  - 

Re: [pgadmin-hackers] PATCH: pgadmin 4: FTS Parser

2016-04-07 Thread Sanket Mehta
Hi,

PFA the revised patch.
response is inline.

Please do review the patch and revert with comments if any.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Apr 4, 2016 at 1:24 PM, Ashesh Vashi <ashesh.va...@enterprisedb.com>
wrote:

> On Mon, Mar 28, 2016 at 2:32 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA the patch for FTS parser node for review.
>> Please do review it and provide the comments.
>>
> Hi Sanket,
>
> Thanks for the patch.
> Please find my review comments.
>
> * 'current_app' has been imported but not used.
>
Fixed (it is used now for logging)

* Few variables are assigned, but not used further.
>
  one of the example: "res = []" (fts_parser/__init__py line#271
>
Unused variables are removed

* 'gone' is used, but - not imported.
>
Fixed

* Do not require __init__(...) function in the 'FtsParserModule' class, as
> it does not do anything here.
>
Removed

* Load the module with the database (not, schema), as it may be require to
> show in dependencies list in the database.
>
Fixed


> * Some of the lines/comments are going beyond the line length limit (i.e.
> more than 80 character per length).
>
Fixed

* Please add comments for all the methods in FtsParserView.
>
Fixed

* Do not need the URL routes for get_start, get_token, get_token,
> get_headline with id, as it does not use the fts parse id. Declare these
> URL-routes without id  for these methods.
>
Fixed

* Create separate templates for each methods instead of club them together
> for the above methods.
>
Ignored as discussed with Ashesh.

* HTTP method GET implies for getting/fetching the information/data from
> the server. Please remove the 'get_' from the above methods,
>
Fixed


> * Inline comments for __init__ method (FtsParserView class) is missing.
>
Fixed

* Do not need to override the 'module_js' method, it has already been
> implemented in PGChildNodeView class.
>
Fixed

* Please fix the correctness of the comments for all the methods. Avoid
> copy/paste from other modules.
>
Fixed

* Check for the version before setting the template_path variable in
> check_precondition method is not required.
>
Ignored as per discussion with Ashesh.

* Check the existence of the node/object before assuming, it is available
> (otherwise - return with 'gone') in node, and properties method. SQL may
> not fail, but - no of records returned will be 0 (zero).
>
Fixed


> * Please test the module on Python 3 too.
>
Fixed

* Use generate_browser_node from the 'update' method after successful
> operation, while generating the result.
>
Fixed

* Do not catch exception (if not required) (i.e. in 'update' method, you
> will not be able to catch the actual issue in that case). Please remove all
> unwanted exceptions.
>
Fixed


> * Log the exception with the application, whenever we catch them.
>
Fixed


>
> Note:
> I've not yet tested the patch.
> These are the review comments from the python code only.
> You may also want to look at the javascript module before sending for
> review again.
> (i.e. code should be wrapped after the line #79.)
>
Fixed

>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> <http://www.enterprisedb.com/>
>
>
> *http://www.linkedin.com/in/asheshvashi*
> <http://www.linkedin.com/in/asheshvashi>
>
>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
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
new file mode 100644
index 000..4f625b4
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/__init__.py
@@ -0,0 +1,858 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Parser node"""
+
+import json
+from flask import render_template, request, jsonify, current_app
+from flask.ext.babel import gettext as _
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.brows

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-04-07 Thread Sanket Mehta
Hi,

Sorry about that issue,

Its resolved now.

PFA the right patch with this mail.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Apr 7, 2016 at 2:39 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Mon, Mar 28, 2016 at 10:01 AM, Sanket Mehta
> <sanket.me...@enterprisedb.com> wrote:
> > Hi Dave,
> >
> > I have found out the root cause of this issue.
> >
> > This issue is occurring at your side as you are using python 2.7 so in
> that
> > case sql query returned from sql template is of type 'unicode'.
> > And in __init__.py file we have checked if the sql query is of string
> type
> > then only we would proceed further.
> >
> > I was not getting this issue as I was using python 3.0
> >
> > I have resolved this issue and some other typo errors in comments and
> patch
> > is attached with this mail.
> >
> > Please do review it and let me know in case of any issues.
>
> Did you send the right patch? I'm still getting the error
> (specifically, when rendering update.sql, render_template throws an
> exception "can't adapt type 'Undefined'")
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..bc80440
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,719 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Template node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils import SchemaChildModule
+from pgadmin.browser.server_groups.servers.databases import DatabaseModule
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsTemplateModule(SchemaChildModule):
+"""
+ class FtsTemplateModule(SchemaChildModule)
+
+A module class for FTS Template node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsTemplateModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for FTS Template, when any of the schema node is
+initialized.
+"""
+NODE_TYPE = 'fts_template'
+COLLECTION_LABEL = gettext('FTS Templates')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(FtsTemplateModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema node is
+initialized.
+"""
+return DatabaseModule.NODE_TYPE
+
+
+blueprint = FtsTemplateModule(__name__)
+
+
+class FtsTemplateView(PGChildNodeView):
+"""
+class FtsTemplateView(PGChildNodeView)
+
+A view class for FTS Tempalte node derived from PGChildNodeView. This class is
+responsible for all the stuff related to view like create/update/delete
+responsible for all the stuff related to view like create/update/delete
+FTS template, showing properties of node, showing sql in sql pane.
+

[pgadmin-hackers] PATCH: pgadmin 4: FTS Parser

2016-03-28 Thread Sanket Mehta
Hi,

PFA the patch for FTS parser node for review.
Please do review it and provide the comments.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
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
new file mode 100644
index 000..90a64b5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/__init__.py
@@ -0,0 +1,816 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Parser node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils import SchemaChildModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsParserModule(SchemaChildModule):
+"""
+ class FtsParserModule(SchemaChildModule)
+
+A module class for FTS Parser node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsParserModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for FTS Parser, when any of the schema node is
+initialized.
+"""
+NODE_TYPE = 'fts_parser'
+COLLECTION_LABEL = gettext('FTS Parsers')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(FtsParserModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema node is
+initialized.
+"""
+return schemas.SchemaModule.NODE_TYPE
+
+
+blueprint = FtsParserModule(__name__)
+
+
+class FtsParserView(PGChildNodeView):
+"""
+class FtsParserView(PGChildNodeView)
+
+A view class for FTS Parser node derived from PGChildNodeView. This class is
+responsible for all the stuff related to view like create/update/delete
+responsible for all the stuff related to view like create/update/delete
+FTS Parser, showing properties of node, showing sql in sql pane.
+
+Methods:
+---
+* __init__(**kwargs)
+  - Method is used to initialize the FtsParserView and it's base view.
+
+* module_js()
+  - This property defines (if javascript) exists for this node.
+Override this property for your own logic
+
+* check_precondition()
+  - This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+
+* list()
+  - This function is used to list all the  nodes within that collection.
+
+* nodes()
+  - This function will used to create all the child node within that collection.
+Here it will create all the FTS Parser nodes.
+
+* properties(gid, sid, did, scid, pid)
+  - This function will show the properties of the selected FTS Parser node
+
+* create(gid, sid, did, scid)
+  - This function will create the new FTS Parser object
+
+* update(gid, sid, did, scid, pid)
+  - This function will update the data for the selected FTS Parser node
+
+* delete(self, gid, sid, did, scid, pid):
+  - This function will drop the FTS Parser object
+
+* msql(gid, sid, did, scid, pid)
+  - This function is used to return

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-03-28 Thread Sanket Mehta
Hi Dave,

I have found out the root cause of this issue.

This issue is occurring at your side as you are using python 2.7 so in that
case sql query returned from sql template is of type 'unicode'.
And in __init__.py file we have checked if the sql query is of string type
then only we would proceed further.

I was not getting this issue as I was using python 3.0

I have resolved this issue and some other typo errors in comments and patch
is attached with this mail.

Please do review it and let me know in case of any issues.





Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Mar 22, 2016 at 8:11 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi,
>
> This seems to be fine, except:
>
> - The icons were missing from the patch (I added them manually)
>
> - The issue you couldn't reproduce that I reported previously still
> exists. I created an FTS template per the attached screenshots, and
> the SQL tab shows only "Modified SQL". The template is correctly
> created though. When I edit the template, I can also successfully
> rename it and update the comment, though the SQL tab still says
> "Modified SQL".
>
>
>
> On Wed, Mar 16, 2016 at 7:10 AM, Sanket Mehta
> <sanket.me...@enterprisedb.com> wrote:
> > Hi,
> >
> > Sorry its misunderstanding from my side.
> > That node refresh on tree issue has been resolved.
> >
> > Patch is attached with this mail.
> >
> > Please do review it.
> >
> > Regards,
> > Sanket Mehta
> > Sr Software engineer
> > Enterprisedb
> >
> > On Mon, Mar 14, 2016 at 7:27 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> On Mon, Mar 14, 2016 at 1:52 PM, Sanket Mehta
> >> <sanket.me...@enterprisedb.com> wrote:
> >> > Hi Dave,
> >> >
> >> > I have incorporated your changes.
> >> > I have also tried to reproduce the Issues that you have mentioned.
> >> > find the response inline.
> >> >
> >> > Also find revised patch having your suggested changes attached with
> this
> >> > mail.
> >> > Please do review it and let me know in case anything is missing.
> >> >
> >> >
> >> > Regards,
> >> > Sanket Mehta
> >> > Sr Software engineer
> >> > Enterprisedb
> >> >
> >> > On Fri, Mar 11, 2016 at 6:41 PM, Dave Page <dp...@pgadmin.org> wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> On Thu, Mar 10, 2016 at 6:28 AM, Sanket Mehta
> >> >> <sanket.me...@enterprisedb.com> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > PFA the patch for fts template after replacing collectionNodeModule
> >> >> > with
> >> >> > SchemaChildModule in __init__.py
> >> >> >
> >> >> > Apart from that, there was an error while updating the name of fts
> >> >> > template
> >> >> > which I have resolved in the same.
> >> >> >
> >> >> > Please do review it and let me know in case of any changes.
> >> >>
> >> >> I've updated the patch for consistency with others. Please find
> >> >> attached. Aside from those changes, there are two issues:
> >> >>
> >> >> - When creating or editing a template the SQL pane just says
> >> >> "--modified SQL" even when all required options are specified. The
> >> >> template is created correctly though.
> >> >
> >> > I have tried to reproduce this issue on my system but could not
> >> > reproduce
> >> > it. PFA screen shorts explaining sql I got while creating and editing
> a
> >> > template.
> >> >
> >> >>
> >> >> - If a template is renamed, the treeview node is not updated.
> >> >
> >> > This is generic issue and needed to be resolved at higher level.
> >>
> >> No, I tested other nodes (database and sequence for example) and they
> >> were properly updated. It's possible *some* are broken, but it's
> >> certainly not a general issue.
> >>
> >>
> >> --
> >> 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
>
>

Re: [pgadmin-hackers] patch for cast module

2016-03-16 Thread Sanket Mehta
Hi,

I forgot tot mention bugs in previous mail.


1. System cast field was showing Yes even if the cast was not a system
cast, which I have resolved.
2. In Dependent and Dependency method in __init__.py  file, unnecessary
third parameter 'cast' was being passed which I have removed



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Mar 16, 2016 at 12:43 PM, Sanket Mehta <
sanket.me...@enterprisedb.com> wrote:

> Hi Dave,
>
> PFA the patch for cast module incorporating changes regarding showing
> system objects.
> Apart from support for showing system object I have resolved few bugs in
> that, unnecessary code and added nodes.sql file.
>
> Please do review it and if it looks good, please commit.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Fri, Mar 4, 2016 at 4:33 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Thanks, patch applied.
>>
>> On Tue, Mar 1, 2016 at 7:20 AM, Sanket Mehta
>> <sanket.me...@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > There was an error in cast module while fetching its dependency and
>> > dependent.
>> > Below is the patch which resolves this issue.
>> > Please review and commit it.
>> >
>> >
>> >
>> > Regards,
>> > Sanket Mehta
>> > Sr Software engineer
>> > Enterprisedb
>> >
>> > On Wed, Feb 24, 2016 at 10:17 PM, Dave Page <dp...@pgadmin.org> wrote:
>> >>
>> >> Thanks - committed.
>> >>
>> >> On Tue, Feb 23, 2016 at 1:34 PM, Sanket Mehta
>> >> <sanket.me...@enterprisedb.com> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> PFA the revised patch as per your comments.
>> >>> Please review it and let me know the feedback.
>> >>>
>> >>> Regards,
>> >>> Sanket Mehta
>> >>> Sr Software engineer
>> >>> Enterprisedb
>> >>>
>> >>> On Tue, Feb 23, 2016 at 4:10 PM, Dave Page <dp...@pgadmin.org> wrote:
>> >>>>
>> >>>> Hi
>> >>>>
>> >>>> I've attached an update to this patch, in which I've done some
>> >>>> word-smithing on various comments, and adjusted the SQL templates to
>> improve
>> >>>> the formatting.
>> >>>>
>> >>>> However, it looks like it's bit-rotted, as the
>> dependents/dependencies
>> >>>> display is throwing Python errors. Please fix and then I think it's
>> just
>> >>>> about ready to commit.
>> >>>>
>> >>>> Thanks.
>> >>>>
>> >>>>
>> >>>> On Fri, Feb 19, 2016 at 11:03 AM, Sanket Mehta
>> >>>> <sanket.me...@enterprisedb.com> wrote:
>> >>>>>
>> >>>>> Hi Dave,
>> >>>>>
>> >>>>> PFA the revise patch.
>> >>>>>
>> >>>>> It includes changes according to your review comments as well as
>> >>>>> dependency/dependent part also.
>> >>>>>
>> >>>>> Let me know in case anything is missing.
>> >>>>>
>> >>>>> Regards,
>> >>>>> Sanket Mehta
>> >>>>> Sr Software engineer
>> >>>>> Enterprisedb
>> >>>>>
>> >>>>> On Mon, Feb 15, 2016 at 10:25 PM, Dave Page <dp...@pgadmin.org>
>> wrote:
>> >>>>>>
>> >>>>>> And this time with the attachment...
>> >>>>>>
>> >>>>>> On Mon, Feb 15, 2016 at 4:53 PM, Dave Page <dp...@pgadmin.org>
>> wrote:
>> >>>>>>>
>> >>>>>>> That's much better. Just a couple of comments now, partly based
>> on an
>> >>>>>>> email I wrote earlier:
>> >>>>>>>
>> >>>>>>> - There is still inconsistency in comment style. Please see the
>> >>>>>>> attachment for an example. Note that there is *always* a space
>> between the
>> >>>>>>> comment marker and text.
>> >>>>>>>
>> >>>>>>> - If I try to edit a cast, I can change the description - but no
>> SQL
>> >>>>>>> is shown on the SQL tab, despite the comment being correctly
>> 

Re: [pgadmin-hackers] patch for cast module

2016-03-16 Thread Sanket Mehta
Hi Dave,

PFA the patch for cast module incorporating changes regarding showing
system objects.
Apart from support for showing system object I have resolved few bugs in
that, unnecessary code and added nodes.sql file.

Please do review it and if it looks good, please commit.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Mar 4, 2016 at 4:33 PM, Dave Page <dp...@pgadmin.org> wrote:

> Thanks, patch applied.
>
> On Tue, Mar 1, 2016 at 7:20 AM, Sanket Mehta
> <sanket.me...@enterprisedb.com> wrote:
> > Hi,
> >
> > There was an error in cast module while fetching its dependency and
> > dependent.
> > Below is the patch which resolves this issue.
> > Please review and commit it.
> >
> >
> >
> > Regards,
> > Sanket Mehta
> > Sr Software engineer
> > Enterprisedb
> >
> > On Wed, Feb 24, 2016 at 10:17 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Thanks - committed.
> >>
> >> On Tue, Feb 23, 2016 at 1:34 PM, Sanket Mehta
> >> <sanket.me...@enterprisedb.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> PFA the revised patch as per your comments.
> >>> Please review it and let me know the feedback.
> >>>
> >>> Regards,
> >>> Sanket Mehta
> >>> Sr Software engineer
> >>> Enterprisedb
> >>>
> >>> On Tue, Feb 23, 2016 at 4:10 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>>>
> >>>> Hi
> >>>>
> >>>> I've attached an update to this patch, in which I've done some
> >>>> word-smithing on various comments, and adjusted the SQL templates to
> improve
> >>>> the formatting.
> >>>>
> >>>> However, it looks like it's bit-rotted, as the dependents/dependencies
> >>>> display is throwing Python errors. Please fix and then I think it's
> just
> >>>> about ready to commit.
> >>>>
> >>>> Thanks.
> >>>>
> >>>>
> >>>> On Fri, Feb 19, 2016 at 11:03 AM, Sanket Mehta
> >>>> <sanket.me...@enterprisedb.com> wrote:
> >>>>>
> >>>>> Hi Dave,
> >>>>>
> >>>>> PFA the revise patch.
> >>>>>
> >>>>> It includes changes according to your review comments as well as
> >>>>> dependency/dependent part also.
> >>>>>
> >>>>> Let me know in case anything is missing.
> >>>>>
> >>>>> Regards,
> >>>>> Sanket Mehta
> >>>>> Sr Software engineer
> >>>>> Enterprisedb
> >>>>>
> >>>>> On Mon, Feb 15, 2016 at 10:25 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >>>>>>
> >>>>>> And this time with the attachment...
> >>>>>>
> >>>>>> On Mon, Feb 15, 2016 at 4:53 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >>>>>>>
> >>>>>>> That's much better. Just a couple of comments now, partly based on
> an
> >>>>>>> email I wrote earlier:
> >>>>>>>
> >>>>>>> - There is still inconsistency in comment style. Please see the
> >>>>>>> attachment for an example. Note that there is *always* a space
> between the
> >>>>>>> comment marker and text.
> >>>>>>>
> >>>>>>> - If I try to edit a cast, I can change the description - but no
> SQL
> >>>>>>> is shown on the SQL tab, despite the comment being correctly
> applied when I
> >>>>>>> hit save. The properties pane of the main window is also not
> updated.
> >>>>>>>
> >>>>>>> Otherwise, it looks fine.
> >>>>>>>
> >>>>>>> Thanks.
> >>>>>>>
> >>>>>>> On Mon, Feb 15, 2016 at 1:28 PM, Sanket Mehta
> >>>>>>> <sanket.me...@enterprisedb.com> wrote:
> >>>>>>>>
> >>>>>>>> Hi,
> >>>>>>>>
> >>>>>>>> PFA the revised patch with all the required comments.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Regards,
> >>>>>>>&g

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-03-16 Thread Sanket Mehta
Hi,

Sorry its misunderstanding from my side.
That node refresh on tree issue has been resolved.

Patch is attached with this mail.

Please do review it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Mar 14, 2016 at 7:27 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Mon, Mar 14, 2016 at 1:52 PM, Sanket Mehta
> <sanket.me...@enterprisedb.com> wrote:
> > Hi Dave,
> >
> > I have incorporated your changes.
> > I have also tried to reproduce the Issues that you have mentioned.
> > find the response inline.
> >
> > Also find revised patch having your suggested changes attached with this
> > mail.
> > Please do review it and let me know in case anything is missing.
> >
> >
> > Regards,
> > Sanket Mehta
> > Sr Software engineer
> > Enterprisedb
> >
> > On Fri, Mar 11, 2016 at 6:41 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Hi
> >>
> >> On Thu, Mar 10, 2016 at 6:28 AM, Sanket Mehta
> >> <sanket.me...@enterprisedb.com> wrote:
> >> > Hi,
> >> >
> >> > PFA the patch for fts template after replacing collectionNodeModule
> with
> >> > SchemaChildModule in __init__.py
> >> >
> >> > Apart from that, there was an error while updating the name of fts
> >> > template
> >> > which I have resolved in the same.
> >> >
> >> > Please do review it and let me know in case of any changes.
> >>
> >> I've updated the patch for consistency with others. Please find
> >> attached. Aside from those changes, there are two issues:
> >>
> >> - When creating or editing a template the SQL pane just says
> >> "--modified SQL" even when all required options are specified. The
> >> template is created correctly though.
> >
> > I have tried to reproduce this issue on my system but could not reproduce
> > it. PFA screen shorts explaining sql I got while creating and editing a
> > template.
> >
> >>
> >> - If a template is renamed, the treeview node is not updated.
> >
> > This is generic issue and needed to be resolved at higher level.
>
> No, I tested other nodes (database and sequence for example) and they
> were properly updated. It's possible *some* are broken, but it's
> certainly not a general issue.
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..0a05cad
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,723 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Template node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils import SchemaChildModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsTemplateModule(SchemaChildModule):
+"""
+ class FtsTemplateModule(SchemaChildModule)
+
+A module class for FTS Template node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsTemplateModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for FTS Template, when any of the schema node is
+initialized.
+"""
+NODE_TYPE = 'fts_template'
+COLLECTION_LABEL = gettext('FTS Templates')
+
+def __init__(self, *args, **kwargs):
+   

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-03-14 Thread Sanket Mehta
Hi Dave,

I have incorporated your changes.
I have also tried to reproduce the Issues that you have mentioned.
find the response inline.

Also find revised patch having your suggested changes attached with this
mail.
Please do review it and let me know in case anything is missing.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Mar 11, 2016 at 6:41 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Thu, Mar 10, 2016 at 6:28 AM, Sanket Mehta
> <sanket.me...@enterprisedb.com> wrote:
> > Hi,
> >
> > PFA the patch for fts template after replacing collectionNodeModule with
> > SchemaChildModule in __init__.py
> >
> > Apart from that, there was an error while updating the name of fts
> template
> > which I have resolved in the same.
> >
> > Please do review it and let me know in case of any changes.
>
> I've updated the patch for consistency with others. Please find
> attached. Aside from those changes, there are two issues:
>
> - When creating or editing a template the SQL pane just says
> "--modified SQL" even when all required options are specified. The
> template is created correctly though.
>
I have tried to reproduce this issue on my system but could not reproduce
it. PFA screen shorts explaining sql I got while creating and editing a
template.


> - If a template is renamed, the treeview node is not updated.
>
This is generic issue and needed to be resolved at higher level.

>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..43e7457
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,700 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Template node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils import SchemaChildModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsTemplateModule(SchemaChildModule):
+"""
+ class FtsTemplateModule(SchemaChildModule)
+
+A module class for FTS Template node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsTemplateModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for FTS Template, when any of the schema node is
+initialized.
+"""
+NODE_TYPE = 'fts_template'
+COLLECTION_LABEL = gettext('FTS Templates')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(FtsTemplateModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema node is
+initialized.
+"""
+return schemas.SchemaModule.NODE_TYPE
+
+
+blueprint = FtsTemplateModule(__name__)
+
+
+class FtsTemplateView(PGChildNodeView):
+"""
+class FtsTemplateView(PGChildNodeView

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-03-09 Thread Sanket Mehta
Hi,

PFA the patch for fts template after *replacing collectionNodeModule with
SchemaChildModule* in __init__.py

Apart from that, there was an error while updating the name of fts template
which I have resolved in the same.

Please do review it and let me know in case of any changes.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Mar 1, 2016 at 4:56 PM, Sanket Mehta <sanket.me...@enterprisedb.com>
wrote:

> Hi Dave,
>
> For your first comment,
>
>  "When creating a new template, errors in the dialogue are not cleared -
> e.g. the "Name must not be empty" doesn't clear, and save is not enabled,
> even when a name is entered."
>
> This issue should not be handled only at FTS template level but the top
> level as it occurs in all nodes.
> I have created a bug node in kanban-chi regarding the same.
> We will take this issue as per priority and send the patch for the same
> later.
>
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Tue, Mar 1, 2016 at 4:34 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> All comments are resolved.
>> PFA the revised patch.
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Thu, Feb 25, 2016 at 7:37 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> On Tue, Feb 23, 2016 at 1:44 PM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> PFA the revised patch for fts template node which includes dependency
>>>> and dependent route handling code.
>>>> Please do review it and if found proper please do commit it.
>>>>
>>>
>>> - When creating a new template, errors in the dialogue are not cleared -
>>> e.g. the "Name must not be empty" doesn't clear, and save is not enabled,
>>> even when a name is entered.
>>>
>>> - "Fts Templates" should be "FTS Templates" on the treeview.
>>>
>>> - The "Init" field should be labelled "Init Function"
>>>
>>> - The "Lexize" field should be labelled "Lexize Function"
>>>
>>> - Selecting a schema should be optional, with the default being the
>>> current schema.
>>>
>>> - 4 character indents are not consistently used in SQL templates
>>>
>>> Thanks.
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..c266c85
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,700 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Template node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils import SchemaChildModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsTemplateModule(SchemaChildModule):
+"""
+ class FtsTemplateModule(SchemaChildModule)
+
+A module class for FTS Template node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsTemplateModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-03-01 Thread Sanket Mehta
Hi Dave,

All comments are resolved.
PFA the revised patch.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Feb 25, 2016 at 7:37 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Tue, Feb 23, 2016 at 1:44 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA the revised patch for fts template node which includes dependency and
>> dependent route handling code.
>> Please do review it and if found proper please do commit it.
>>
>
> - When creating a new template, errors in the dialogue are not cleared -
> e.g. the "Name must not be empty" doesn't clear, and save is not enabled,
> even when a name is entered.
>
> - "Fts Templates" should be "FTS Templates" on the treeview.
>
> - The "Init" field should be labelled "Init Function"
>
> - The "Lexize" field should be labelled "Lexize Function"
>
> - Selecting a schema should be optional, with the default being the
> current schema.
>
> - 4 character indents are not consistently used in SQL templates
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..7091c93
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,700 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Template node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsTemplateModule(CollectionNodeModule):
+"""
+ class FtsTemplateModule(CollectionNodeModule)
+
+A module class for FTS Template node derived from CollectionNodeModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsTemplateModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for FTS Template, when any of the schema node is
+initialized.
+"""
+NODE_TYPE = 'fts_template'
+COLLECTION_LABEL = gettext('FTS Templates')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(FtsTemplateModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema node is
+initialized.
+"""
+return schemas.SchemaModule.NODE_TYPE
+
+
+blueprint = FtsTemplateModule(__name__)
+
+
+class FtsTemplateView(PGChildNodeView):
+"""
+class FtsTemplateView(PGChildNodeView)
+
+A view class for FTS Tempalte node derived from PGChildNodeView. This class is
+responsible for all the stuff related to view like create/update/delete
+FTS template, showing properties of node, showing sql in sql pane.
+
+Methods:
+---
+* __init__(**kwargs)
+  - Method is used to initialize the FtsTemplateView and it's ba

Re: [pgadmin-hackers] patch for cast module

2016-02-29 Thread Sanket Mehta
Hi,

There was an error in cast module while fetching its dependency and
dependent.
Below is the patch which resolves this issue.
Please review and commit it.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Feb 24, 2016 at 10:17 PM, Dave Page <dp...@pgadmin.org> wrote:

> Thanks - committed.
>
> On Tue, Feb 23, 2016 at 1:34 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA the revised patch as per your comments.
>> Please review it and let me know the feedback.
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Tue, Feb 23, 2016 at 4:10 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> I've attached an update to this patch, in which I've done some
>>> word-smithing on various comments, and adjusted the SQL templates to
>>> improve the formatting.
>>>
>>> However, it looks like it's bit-rotted, as the dependents/dependencies
>>> display is throwing Python errors. Please fix and then I think it's just
>>> about ready to commit.
>>>
>>> Thanks.
>>>
>>>
>>> On Fri, Feb 19, 2016 at 11:03 AM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> PFA the revise patch.
>>>>
>>>> It includes changes according to your review comments as well as
>>>> dependency/dependent part also.
>>>>
>>>> Let me know in case anything is missing.
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>> On Mon, Feb 15, 2016 at 10:25 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> And this time with the attachment...
>>>>>
>>>>> On Mon, Feb 15, 2016 at 4:53 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> That's much better. Just a couple of comments now, partly based on an
>>>>>> email I wrote earlier:
>>>>>>
>>>>>> - There is still inconsistency in comment style. Please see the
>>>>>> attachment for an example. Note that there is *always* a space between 
>>>>>> the
>>>>>> comment marker and text.
>>>>>>
>>>>>> - If I try to edit a cast, I can change the description - but no SQL
>>>>>> is shown on the SQL tab, despite the comment being correctly applied 
>>>>>> when I
>>>>>> hit save. The properties pane of the main window is also not updated.
>>>>>>
>>>>>> Otherwise, it looks fine.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Mon, Feb 15, 2016 at 1:28 PM, Sanket Mehta <
>>>>>> sanket.me...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> PFA the revised patch with all the required comments.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>> Sanket Mehta
>>>>>>> Sr Software engineer
>>>>>>> Enterprisedb
>>>>>>>
>>>>>>> On Mon, Feb 15, 2016 at 4:18 PM, Dave Page <dp...@pgadmin.org>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Feb 15, 2016 at 8:10 AM, Sanket Mehta <
>>>>>>>> sanket.me...@enterprisedb.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Dave,
>>>>>>>>>
>>>>>>>>> Regarding your suggestion of putting some comments in javascript,
>>>>>>>>> I think I have already put some comments regarding model data and 
>>>>>>>>> their
>>>>>>>>> controls if any extended.
>>>>>>>>>
>>>>>>>>> Can you please let me know where exactly you think more comments
>>>>>>>>> are required?
>>>>>>>>>
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> The issue for me is that jQuery code isn't the easiest to read at
>>>>>>>> the best

Re: [pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-02-23 Thread Sanket Mehta
Hi,

PFA the revised patch for fts template node which includes dependency and
dependent route handling code.
Please do review it and if found proper please do commit it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Jan 28, 2016 at 7:21 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi,
>
> I have created patch for "FTS Template" node in pgadmin4.
> Please do review it and let me know in case anything is missing.
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..0535040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,700 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Template node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsTemplateModule(CollectionNodeModule):
+"""
+ class FtsTemplateModule(CollectionNodeModule)
+
+A module class for FTS Template node derived from CollectionNodeModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsTemplateModule and it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for FTS Template, when any of the schema node is
+initialized.
+"""
+NODE_TYPE = 'fts_template'
+COLLECTION_LABEL = gettext('Fts Templates')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(FtsTemplateModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema node is
+initialized.
+"""
+return schemas.SchemaModule.NODE_TYPE
+
+
+blueprint = FtsTemplateModule(__name__)
+
+
+class FtsTemplateView(PGChildNodeView):
+"""
+class FtsTemplateView(PGChildNodeView)
+
+A view class for FTS Tempalte node derived from PGChildNodeView. This class is
+responsible for all the stuff related to view like create/update/delete
+FTS template, showing properties of node, showing sql in sql pane.
+
+Methods:
+---
+* __init__(**kwargs)
+  - Method is used to initialize the FtsTemplateView and it's base view.
+
+* module_js()
+  - This property defines (if javascript) exists for this node.
+Override this property for your own logic
+
+* check_precondition()
+  - This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+
+* list()
+  - This function is used to list all the  nodes within that collection.
+
+* nodes()
+  - This function will used to create all the child node within that collection.
+Here it will create all the FTS Template nodes.
+
+* properties(gid, sid, did, rg_id)
+  - This function will show the properties of the selected FTS Template node
+
+* create(gid, sid, did, rg_id)
+  - This function will create th

Re: [pgadmin-hackers] patch for cast module

2016-02-23 Thread Sanket Mehta
Hi,

PFA the revised patch as per your comments.
Please review it and let me know the feedback.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Feb 23, 2016 at 4:10 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> I've attached an update to this patch, in which I've done some
> word-smithing on various comments, and adjusted the SQL templates to
> improve the formatting.
>
> However, it looks like it's bit-rotted, as the dependents/dependencies
> display is throwing Python errors. Please fix and then I think it's just
> about ready to commit.
>
> Thanks.
>
>
> On Fri, Feb 19, 2016 at 11:03 AM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> PFA the revise patch.
>>
>> It includes changes according to your review comments as well as
>> dependency/dependent part also.
>>
>> Let me know in case anything is missing.
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Mon, Feb 15, 2016 at 10:25 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> And this time with the attachment...
>>>
>>> On Mon, Feb 15, 2016 at 4:53 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> That's much better. Just a couple of comments now, partly based on an
>>>> email I wrote earlier:
>>>>
>>>> - There is still inconsistency in comment style. Please see the
>>>> attachment for an example. Note that there is *always* a space between the
>>>> comment marker and text.
>>>>
>>>> - If I try to edit a cast, I can change the description - but no SQL is
>>>> shown on the SQL tab, despite the comment being correctly applied when I
>>>> hit save. The properties pane of the main window is also not updated.
>>>>
>>>> Otherwise, it looks fine.
>>>>
>>>> Thanks.
>>>>
>>>> On Mon, Feb 15, 2016 at 1:28 PM, Sanket Mehta <
>>>> sanket.me...@enterprisedb.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> PFA the revised patch with all the required comments.
>>>>>
>>>>>
>>>>>
>>>>> Regards,
>>>>> Sanket Mehta
>>>>> Sr Software engineer
>>>>> Enterprisedb
>>>>>
>>>>> On Mon, Feb 15, 2016 at 4:18 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Feb 15, 2016 at 8:10 AM, Sanket Mehta <
>>>>>> sanket.me...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> Regarding your suggestion of putting some comments in javascript, I
>>>>>>> think I have already put some comments regarding model data and their
>>>>>>> controls if any extended.
>>>>>>>
>>>>>>> Can you please let me know where exactly you think more comments are
>>>>>>> required?
>>>>>>>
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> The issue for me is that jQuery code isn't the easiest to read at the
>>>>>> best of times, with nested/anonymous functions and inline JSON etc. As I
>>>>>> look through the code for the various nodes in isolation, it's extremely
>>>>>> difficult to get a sense of what exactly each part of the code is doing. 
>>>>>> In
>>>>>> this example, what I see by reading the code is:
>>>>>>
>>>>>> - Define the required libraries (require.js stuff)
>>>>>> - Extend the collection class
>>>>>> - Extend the node class
>>>>>>   - Define an init function inline
>>>>>>   - Add the menu options
>>>>>>
>>>>>> That part is fairly easy to figure out (easier because there are
>>>>>> blank lines between the logical sections). From there though, it becomes
>>>>>> much harder;
>>>>>>
>>>>>> - There are no blank lines to separate logical code sections at all
>>>>>> between line 48 and 235 (there is one blank line, but it doesn't separate
>>>>>> code sections).
>>>>>> - There are 4 comments that I can see. The first two are identical,
>>>>>> and appear to have ident

Re: [pgadmin-hackers] patch for cast module

2016-02-19 Thread Sanket Mehta
Hi Dave,

PFA the revise patch.

It includes changes according to your review comments as well as
dependency/dependent part also.

Let me know in case anything is missing.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Feb 15, 2016 at 10:25 PM, Dave Page <dp...@pgadmin.org> wrote:

> And this time with the attachment...
>
> On Mon, Feb 15, 2016 at 4:53 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> That's much better. Just a couple of comments now, partly based on an
>> email I wrote earlier:
>>
>> - There is still inconsistency in comment style. Please see the
>> attachment for an example. Note that there is *always* a space between the
>> comment marker and text.
>>
>> - If I try to edit a cast, I can change the description - but no SQL is
>> shown on the SQL tab, despite the comment being correctly applied when I
>> hit save. The properties pane of the main window is also not updated.
>>
>> Otherwise, it looks fine.
>>
>> Thanks.
>>
>> On Mon, Feb 15, 2016 at 1:28 PM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA the revised patch with all the required comments.
>>>
>>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Mon, Feb 15, 2016 at 4:18 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>>
>>>>
>>>> On Mon, Feb 15, 2016 at 8:10 AM, Sanket Mehta <
>>>> sanket.me...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> Regarding your suggestion of putting some comments in javascript, I
>>>>> think I have already put some comments regarding model data and their
>>>>> controls if any extended.
>>>>>
>>>>> Can you please let me know where exactly you think more comments are
>>>>> required?
>>>>>
>>>>
>>>> Hi
>>>>
>>>> The issue for me is that jQuery code isn't the easiest to read at the
>>>> best of times, with nested/anonymous functions and inline JSON etc. As I
>>>> look through the code for the various nodes in isolation, it's extremely
>>>> difficult to get a sense of what exactly each part of the code is doing. In
>>>> this example, what I see by reading the code is:
>>>>
>>>> - Define the required libraries (require.js stuff)
>>>> - Extend the collection class
>>>> - Extend the node class
>>>>   - Define an init function inline
>>>>   - Add the menu options
>>>>
>>>> That part is fairly easy to figure out (easier because there are blank
>>>> lines between the logical sections). From there though, it becomes much
>>>> harder;
>>>>
>>>> - There are no blank lines to separate logical code sections at all
>>>> between line 48 and 235 (there is one blank line, but it doesn't separate
>>>> code sections).
>>>> - There are 4 comments that I can see. The first two are identical, and
>>>> appear to have identical code blocks following them for reasons that are
>>>> not even remotely obvious.
>>>> - As a newcomer to this code, I'm wondering if it's purpose is to
>>>> define the backform model. If so, why is it not broken up into sections
>>>> with a comment to tell me what field each block handles, and any other
>>>> useful information I may need to know? If it's not, then what is it for?
>>>>
>>>> So... I'm not going to tell you exactly where to put comments, because
>>>> the point is that without spending a couple of hours understanding this, I
>>>> simply don't know. The point of the comments (and separation of logical
>>>> sections of code with blank lines) is to make it easy for another developer
>>>> (especially one as rusty as me) to read and understand, then fix and
>>>> improve. Be generous with comments, but don't use them unnecessarily (e.g.
>>>> "a = 1 // Set a to one").
>>>>
>>>> Of course, this is not just directed at you Sanket - it's something all
>>>> of us working on pgAdmin need to keep in mind.
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Dave Page
>>>> Blog: http://pgsnake.blogspot.com
>>>> Twitter: @pgsnake
>>>>
>>>> EnterpriseDB UK: http://www.enterprisedb.com
>

Re: [pgadmin-hackers] patch for cast module

2016-02-15 Thread Sanket Mehta
Hi,

PFA the revised patch with all the required comments.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Feb 15, 2016 at 4:18 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Mon, Feb 15, 2016 at 8:10 AM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Regarding your suggestion of putting some comments in javascript, I think
>> I have already put some comments regarding model data and their controls if
>> any extended.
>>
>> Can you please let me know where exactly you think more comments are
>> required?
>>
>
> Hi
>
> The issue for me is that jQuery code isn't the easiest to read at the best
> of times, with nested/anonymous functions and inline JSON etc. As I look
> through the code for the various nodes in isolation, it's extremely
> difficult to get a sense of what exactly each part of the code is doing. In
> this example, what I see by reading the code is:
>
> - Define the required libraries (require.js stuff)
> - Extend the collection class
> - Extend the node class
>   - Define an init function inline
>   - Add the menu options
>
> That part is fairly easy to figure out (easier because there are blank
> lines between the logical sections). From there though, it becomes much
> harder;
>
> - There are no blank lines to separate logical code sections at all
> between line 48 and 235 (there is one blank line, but it doesn't separate
> code sections).
> - There are 4 comments that I can see. The first two are identical, and
> appear to have identical code blocks following them for reasons that are
> not even remotely obvious.
> - As a newcomer to this code, I'm wondering if it's purpose is to define
> the backform model. If so, why is it not broken up into sections with a
> comment to tell me what field each block handles, and any other useful
> information I may need to know? If it's not, then what is it for?
>
> So... I'm not going to tell you exactly where to put comments, because the
> point is that without spending a couple of hours understanding this, I
> simply don't know. The point of the comments (and separation of logical
> sections of code with blank lines) is to make it easy for another developer
> (especially one as rusty as me) to read and understand, then fix and
> improve. Be generous with comments, but don't use them unnecessarily (e.g.
> "a = 1 // Set a to one").
>
> Of course, this is not just directed at you Sanket - it's something all of
> us working on pgAdmin need to keep in mind.
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
new file mode 100644
index 000..96caffc
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
@@ -0,0 +1,498 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of cast node"""
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import NodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases as databases
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class CastModule(CollectionNodeModule):
+NODE_TYPE = 'cast'
+COLLECTION_LABEL = 'Casts'
+
+def __init__(self, *args, **kwargs):
+super(CastModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+"""
+yield self.generate_browser_collection_node(did)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for cast, when any of

Re: [pgadmin-hackers] patch for cast module

2016-02-15 Thread Sanket Mehta
Hi Dave,

Regarding your suggestion of putting some comments in javascript, I think I
have already put some comments regarding model data and their controls if
any extended.

Can you please let me know where exactly you think more comments are
required?


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Feb 12, 2016 at 9:54 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Fri, Feb 12, 2016 at 11:57 AM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> PFA the updated patch.
>>
>>
> Hi
>
> When testing this patch, I get the following error:
>
> Traceback (most recent call last):
>   File "pgAdmin4.py", line 56, in 
> app = create_app()
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/__init__.py", line 194, in
> create_app
> app.register_blueprint(module)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 62, in wrapper_func
> return f(self, *args, **kwargs)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 889, in register_blueprint
> blueprint.register(self, options, first_registration)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/__init__.py", line 40,
> in register
> app.register_blueprint(module)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 62, in wrapper_func
> return f(self, *args, **kwargs)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 889, in register_blueprint
> blueprint.register(self, options, first_registration)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/__init__.py", line 40,
> in register
> app.register_blueprint(module)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 62, in wrapper_func
> return f(self, *args, **kwargs)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 889, in register_blueprint
> blueprint.register(self, options, first_registration)
>   File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
> line 147, in register
> super(ServerModule, self).register(app, options, first_registration)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/__init__.py", line 40,
> in register
> app.register_blueprint(module)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 62, in wrapper_func
> return f(self, *args, **kwargs)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 889, in register_blueprint
> blueprint.register(self, options, first_registration)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/__init__.py", line 37,
> in register
> self.submodules = list(app.find_submodules(self.import_name))
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/__init__.py", line 42, in
> find_submodules
> module = import_module(module_name)
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
> line 37, in import_module
> __import__(name)
>   File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py",
> line 21, in 
> from html import escape
> ImportError: No module named html
>
> Other comments:
>
> - Leave a blank line before the header block and the first line of Python
> code please.
> - There is no pydoc description for the module.
> - The javascript is almost completely devoid of comments. There should be
> at least a minimal amount to explain what each code block is doing.
> - There should be no blank lines at the top of SQL templates (e.g.
> create.sql).
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] patch for cast module

2016-02-12 Thread Sanket Mehta
Hi Akshay,

PFA the updated patch.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Feb 11, 2016 at 12:09 PM, Akshay Joshi <
akshay.jo...@enterprisedb.com> wrote:

> Hi Sanket
>
> Most of the review comments has been resolved but I found some issues with
> this patch
>
>- When select some system cast it is showing wrong query, for example
>when select "abstime->date" in pgAdmin3 it is showing "AS ASSIGNMENT"
>and with your code it is showing "AS IMPLICIT".
>- For some of the system casts SQL query showing "WITH FUNCTION date"
>instead of "WITH FUNCTION date(abstime)" source type is not appended
>in query with new code.
>- For casts "bit->"bit"" function and target type is not listed.
>- When we create a new cast like "character->bytea" without selecting
>function, it creates successfully but when we select the newly created cast
>it shows the function "bpcharsend" in functions property. It may come
>    for other combinations too, please verify.
>- Please fixed warnings in python file by using pep8 tool.
>
>
> On Mon, Feb 8, 2016 at 3:45 PM, Sanket Mehta <sanket.mehta@enterprisedb
> .com> wrote:
>
>> Hi Akshay,
>>
>> PFA the revised patch.
>> All the comments are inline.
>>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Fri, Feb 5, 2016 at 12:43 PM, Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Sanket
>>>
>>> Below are the review comments
>>>
>>>- As "Show System Object" is not implemented yet, we should show all
>>>the objects by default.
>>>
>>> Done
>>
>>>
>>>- As in pgAdmin3 when click on Casts (Collection) node it should
>>>show only Name, Owner and Comments. With current code it is showing all 
>>> the
>>>properties.
>>>
>>> Done.. Owner field is ignore as it is not a part of cast properties.
>>
>>>
>>>- Properties Tab contains only one control "Comment" can that be a
>>>part of the Definition tab???
>>>- For some data type like "Character", "Integer", it is throwing
>>>error that data type doesn't exist.
>>>
>>> resolved
>>
>>>
>>>- If node is leaf node then it should not show (+) expand symbol.
>>>
>>> Done
>>
>>>
>>>- Remove extra lines from create.sql and update.sql files as it
>>>shown in the SQL tab as well.
>>>
>>> Ignored as it was suggested by Ashesh.
>>
>>>
>>>- When select any system cast it is not showing function in the
>>>function control.
>>>
>>> Resolved.
>>
>>>
>>>- If comment is already exist and we remove the comments, sql query
>>>not generated in the SQL tab while it is generating in pgAdmin3.
>>>
>>> Done.
>>
>>
>>> *Question*: With current implementation in "pgAdmin3" to create "Cast"
>>> user will have to select source type and target type and then click on OK
>>> button. If source and target type is not physically compatible, server will
>>> throw an error. I am not sure, but instead of that can we implement it like
>>> when user select the source type from combo box, target type combo will
>>> only show types which are physically compatible?
>>>
>> After consulting with db server team, it is clear that they do not
>> maintain any mapping for compatible source and target types. in postgresql,
>> they pick selected source and target type and check them for compatibility.
>> So its not possible to filter out target type based on selected source type.
>>
>>>
>>>
>>>
>>> On Thu, Feb 4, 2016 at 6:31 PM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi Akshay,
>>>>
>>>> PFA the latest patch for Cast module.
>>>> Please do review it and let me know if anything is missing.
>>>>
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>> On Wed, Jan 20, 2016 at 5:03 PM, Sanket Mehta <
>>>> sanket.me...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Neel.
>>>>>
>>>>> P

Re: [pgadmin-hackers] patch for cast module

2016-02-08 Thread Sanket Mehta
Hi Akshay,

PFA the revised patch.
All the comments are inline.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Feb 5, 2016 at 12:43 PM, Akshay Joshi <akshay.jo...@enterprisedb.com
> wrote:

> Hi Sanket
>
> Below are the review comments
>
>- As "Show System Object" is not implemented yet, we should show all
>the objects by default.
>
> Done

>
>- As in pgAdmin3 when click on Casts (Collection) node it should show
>only Name, Owner and Comments. With current code it is showing all the
>properties.
>
> Done.. Owner field is ignore as it is not a part of cast properties.

>
>- Properties Tab contains only one control "Comment" can that be a
>part of the Definition tab???
>- For some data type like "Character", "Integer", it is throwing error
>that data type doesn't exist.
>
> resolved

>
>- If node is leaf node then it should not show (+) expand symbol.
>
> Done

>
>- Remove extra lines from create.sql and update.sql files as it shown
>in the SQL tab as well.
>
> Ignored as it was suggested by Ashesh.

>
>- When select any system cast it is not showing function in the
>function control.
>
> Resolved.

>
>- If comment is already exist and we remove the comments, sql query
>not generated in the SQL tab while it is generating in pgAdmin3.
>
> Done.


> *Question*: With current implementation in "pgAdmin3" to create "Cast"
> user will have to select source type and target type and then click on OK
> button. If source and target type is not physically compatible, server will
> throw an error. I am not sure, but instead of that can we implement it like
> when user select the source type from combo box, target type combo will
> only show types which are physically compatible?
>
After consulting with db server team, it is clear that they do not maintain
any mapping for compatible source and target types. in postgresql, they
pick selected source and target type and check them for compatibility. So
its not possible to filter out target type based on selected source type.

>
>
>
> On Thu, Feb 4, 2016 at 6:31 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> PFA the latest patch for Cast module.
>> Please do review it and let me know if anything is missing.
>>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Wed, Jan 20, 2016 at 5:03 PM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Hi Neel.
>>>
>>> PFA the revised patch which has changed according to your comments.
>>> Please do review it and let me know in case anything is missing.
>>>
>>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Wed, Jan 20, 2016 at 10:20 AM, Neel Patel <
>>> neel.pa...@enterprisedb.com> wrote:
>>>
>>>> Hi Sanket,
>>>>
>>>> Below are the review comments.
>>>>
>>>> - When we edit any existing cast node then it gives error "*Response
>>>> object has no attribute strip*". This error is coming because
>>>> generated SQL is
>>>>   wrong.
>>>> - Unnecessary debug logs are coming on console. Please remove
>>>> unnecessary debug logs.
>>>> - In some of the sql file, 'qtIdent' and 'qtLiteral' is not used.
>>>> Please check all the SQL files.
>>>> - "Delete" cast functionality is not working. Error is getting
>>>> displayed saying *"syntax error at or near "castsource"*.
>>>> - "Delete cascade" functionality is not working - error is getting
>>>> displayed saying *"The requested URL not found".*
>>>> - Do the proper comments, in some of the function like "script_load" ,
>>>> comments are wrong.
>>>> - Is "configs" really required in __init__.py file ? We have not seen
>>>> any usage for this. Please remove it if it is not required.
>>>> - Remove commented code from the source file.
>>>>
>>>> Please check all the generated SQL statements . Test the basic
>>>> functionality of "create", "Edit" and "Delete" node before sending patch
>>>> file.
>>>>
>>>> Do let us know for any comments/issues.
>>>>
>>>> Thanks,
>>>> Neel Patel
>>>>
>>

Re: [pgadmin-hackers] patch for cast module

2016-02-04 Thread Sanket Mehta
Hi Akshay,

PFA the latest patch for Cast module.
Please do review it and let me know if anything is missing.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Jan 20, 2016 at 5:03 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi Neel.
>
> PFA the revised patch which has changed according to your comments.
> Please do review it and let me know in case anything is missing.
>
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Wed, Jan 20, 2016 at 10:20 AM, Neel Patel <neel.pa...@enterprisedb.com>
> wrote:
>
>> Hi Sanket,
>>
>> Below are the review comments.
>>
>> - When we edit any existing cast node then it gives error "*Response
>> object has no attribute strip*". This error is coming because generated
>> SQL is
>>   wrong.
>> - Unnecessary debug logs are coming on console. Please remove unnecessary
>> debug logs.
>> - In some of the sql file, 'qtIdent' and 'qtLiteral' is not used. Please
>> check all the SQL files.
>> - "Delete" cast functionality is not working. Error is getting displayed
>> saying *"syntax error at or near "castsource"*.
>> - "Delete cascade" functionality is not working - error is getting
>> displayed saying *"The requested URL not found".*
>> - Do the proper comments, in some of the function like "script_load" ,
>> comments are wrong.
>> - Is "configs" really required in __init__.py file ? We have not seen any
>> usage for this. Please remove it if it is not required.
>> - Remove commented code from the source file.
>>
>> Please check all the generated SQL statements . Test the basic
>> functionality of "create", "Edit" and "Delete" node before sending patch
>> file.
>>
>> Do let us know for any comments/issues.
>>
>> Thanks,
>> Neel Patel
>>
>> On Tue, Jan 19, 2016 at 8:06 PM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA updated patch for cast module as per check list provided by Neel.
>>> Please do review it and let me know in case of anything is missing.
>>>
>>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Mon, Jan 18, 2016 at 7:16 PM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> PFA patch for cast module.
>>>> Please do review it and let me know in case of any issue.
>>>>
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>
>>>
>>>
>>> --
>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>
>>>
>>
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
new file mode 100644
index 000..5bba3d7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
@@ -0,0 +1,436 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import NodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases as databases
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+from html import escape
+
+
+class CastModule(CollectionNodeModule):
+NODE_TYPE = 'cast'
+COLLECTION_LABEL = 'Casts'
+
+def __init__(self, *args, **kwargs):
+super(CastModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did):
+"""
+Generate the collection node
+"""
+yield self.generate_browser_collection_node(did)
+
+@property
+def

[pgadmin-hackers] PATCH: PGADMIN 4 - FTS templates node

2016-01-28 Thread Sanket Mehta
Hi,

I have created patch for "FTS Template" node in pgadmin4.
Please do review it and let me know in case anything is missing.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
new file mode 100644
index 000..a571470
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py
@@ -0,0 +1,430 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import NodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+from html import escape
+
+
+class FtsTemplateModule(CollectionNodeModule):
+NODE_TYPE = 'fts_template'
+COLLECTION_LABEL = gettext('Fts Templates')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(FtsTemplateModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema node is
+initialized.
+"""
+return schemas.SchemaModule.NODE_TYPE
+
+
+blueprint = FtsTemplateModule(__name__)
+
+
+class FtsTemplateView(NodeView):
+node_type = blueprint.node_type
+
+parent_ids = [
+{'type': 'int', 'id': 'gid'},
+{'type': 'int', 'id': 'sid'},
+{'type': 'int', 'id': 'did'},
+{'type': 'int', 'id': 'scid'}
+]
+ids = [
+{'type': 'int', 'id': 'tid'}
+]
+
+operations = dict({
+'obj': [
+{'get': 'properties', 'delete': 'delete', 'put': 'update'},
+{'get': 'list', 'post': 'create'}
+],
+'children': [{
+'get': 'children'
+}],
+'delete': [{'delete': 'delete'}],
+'nodes': [{'get': 'node'}, {'get': 'nodes'}],
+'sql': [{'get': 'sql'}],
+'msql': [{'get': 'msql'}, {'get': 'msql'}],
+'stats': [{'get': 'statistics'}],
+'dependency': [{'get': 'dependencies'}],
+'dependent': [{'get': 'dependents'}],
+'module.js': [{}, {}, {'get': 'module_js'}],
+'getlexize': [{'get': 'getlexize'}, {'get': 'getlexize'}],
+'getinit': [{'get': 'getinit'}, {'get': 'getinit'}],
+})
+
+def module_js(self):
+"""
+This property defines (if javascript) exists for this node.
+Override this property for your own logic.
+"""
+return make_response(
+render_template(
+"fts_template/js/fts_templates.js",
+_=gettext
+),
+200, {'Content-Type': 'application/x-javascript'}
+)
+
+def check_precondition(f):
+"""
+This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+"""
+@wraps(f)
+def wrap(*args, **kwargs):
+# Here args[0] will hold self & kwargs will hold gid,sid,did
+self = args[0]
+self.manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(kwargs['sid'])
+self.conn = self.manager.connection(did=kwargs['did'])
+# If DB not connected then return error to browser
+if not self.conn.connected():
+return precondition_required(
+gettext(
+"Connection to the server has been lost!"
+)
+)
+self.template_path = 'fts_template/sql/'
+return f(*args, **kwargs)
+
+return wrap
+
+
+@check_precondition
+def list(self, gid, sid, did, scid):
+SQL = render_te

[pgadmin-hackers] PATCH: minor issue resolved related to retrieval of last system oid

2016-01-21 Thread Sanket Mehta
Hi,

I found an issue in *connnection* function in
utils/drivers/psycopg2/__init__.py file related to 'datlastsysoid'.
It was not getting retrieved and put inside db_info dict.
Due to this error occurred while expanding cast collection node.


I have resolved the issue and attached a patch with this mail.
Please do review it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py
index c6c87f1..d4205d2 100644
--- a/web/pgadmin/utils/driver/psycopg2/__init__.py
+++ b/web/pgadmin/utils/driver/psycopg2/__init__.py
@@ -568,7 +568,7 @@ class ServerManager(object):
 status, res = conn.execute_dict("""
 SELECT
 db.oid as did, db.datname, db.datallowconn, pg_encoding_to_char(db.encoding) AS serverencoding,
-has_database_privilege(db.oid, 'CREATE') as cancreate
+has_database_privilege(db.oid, 'CREATE') as cancreate, datlastsysoid
 FROM
 pg_database db
 WHERE db.oid = {0}""".format(did))

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


Re: [pgadmin-hackers] patch for cast module

2016-01-20 Thread Sanket Mehta
Hi Neel.

PFA the revised patch which has changed according to your comments.
Please do review it and let me know in case anything is missing.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Jan 20, 2016 at 10:20 AM, Neel Patel <neel.pa...@enterprisedb.com>
wrote:

> Hi Sanket,
>
> Below are the review comments.
>
> - When we edit any existing cast node then it gives error "*Response
> object has no attribute strip*". This error is coming because generated
> SQL is
>   wrong.
> - Unnecessary debug logs are coming on console. Please remove unnecessary
> debug logs.
> - In some of the sql file, 'qtIdent' and 'qtLiteral' is not used. Please
> check all the SQL files.
> - "Delete" cast functionality is not working. Error is getting displayed
> saying *"syntax error at or near "castsource"*.
> - "Delete cascade" functionality is not working - error is getting
> displayed saying *"The requested URL not found".*
> - Do the proper comments, in some of the function like "script_load" ,
> comments are wrong.
> - Is "configs" really required in __init__.py file ? We have not seen any
> usage for this. Please remove it if it is not required.
> - Remove commented code from the source file.
>
> Please check all the generated SQL statements . Test the basic
> functionality of "create", "Edit" and "Delete" node before sending patch
> file.
>
> Do let us know for any comments/issues.
>
> Thanks,
> Neel Patel
>
> On Tue, Jan 19, 2016 at 8:06 PM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA updated patch for cast module as per check list provided by Neel.
>> Please do review it and let me know in case of anything is missing.
>>
>>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Mon, Jan 18, 2016 at 7:16 PM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch for cast module.
>>> Please do review it and let me know in case of any issue.
>>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
new file mode 100644
index 000..37802b0
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
@@ -0,0 +1,402 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import NodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases as databases
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class CastModule(CollectionNodeModule):
+NODE_TYPE = 'cast'
+COLLECTION_LABEL = 'Casts'
+
+def __init__(self, *args, **kwargs):
+super(CastModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did):
+"""
+Generate the collection node
+"""
+yield self.generate_browser_collection_node(did)
+
+@property
+def script_load(self):
+"""
+Load the module script for cast, when any of the database node is
+initialized.
+"""
+return databases.DatabaseModule.NODE_TYPE
+
+
+blueprint = CastModule(__name__)
+
+
+class CastView(NodeView):
+node_type = blueprint.node_type
+
+parent_ids = [
+{'type': 'int', 'id': 'gid'},
+{'type': 'int', 'id': 'sid'},
+{'type': 'int', 'id': 'did'}
+]
+ids = [
+{'type': 'int', 'id': 'cid'}
+]
+
+operations = dict({
+'obj': [
+{'get': 'properties', 'delete'

[pgadmin-hackers] PATCH: resolved an issue occured in cast creation

2016-01-19 Thread Sanket Mehta
Hi,

I have resolved an issue, occurred while creating a new cast.

ISSUE:

While creating a new cast, when user select source type and target type,
below query is used to fetch the function list related to that cast.

SELECT proname, nspname
FROM pg_proc p JOIN pg_namespace n ON n.oid=pronamespace
WHERE proargtypes[0] = 
*AND proargtypes[1] = 0 *
AND prorettype =  

In this query "proargtypes" contains argument type list.
As you can see above proargtypes[1] (2nd argument to function ) is compared
to 0 (in bold)

But according to postgresql standard, "proargtypes" field comparison should
be like this :

proargtypes[1] (if present) should be compared to 23 (int4),
and proargtypes[2] (if present) should be compared to 16 (bool).

I have resolved the issue and patch is attached with this mail.

Please do review it and let me know in case of anything is missing.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/pgadmin/dlg/dlgCast.cpp b/pgadmin/dlg/dlgCast.cpp
index 5975615..c9c3282 100644
--- a/pgadmin/dlg/dlgCast.cpp
+++ b/pgadmin/dlg/dlgCast.cpp
@@ -157,10 +157,14 @@ void dlgCast::OnChangeType(wxCommandEvent )
 		wxT("  JOIN pg_namespace n ON n.oid=pronamespace\n")
 		wxT(" WHERE proargtypes[0] = ")
 		+  GetTypeOid(cbSourceType->GetGuessedSelection())
-		+  wxT("\n   AND proargtypes[1] = 0")
-		wxT("\n   AND prorettype = ")
+			+ wxT("\n AND CASE ")
+			+ wxT("\n WHEN array_length(proargtypes, 1) = 2 THEN")
+			+ wxT("\n proargtypes[1] = 23")
+			+ wxT("\n WHEN array_length(proargtypes, 1) >= 3 THEN")
+			+ wxT("\n proargtypes[1] = 23 AND proargtypes[2] = 16")
+			+ wxT("\n ELSE true END")
+		+ wxT("\n   AND prorettype = ")
 		+  GetTypeOid(cbTargetType->GetGuessedSelection());
-
 		pgSet *set = connection->ExecuteSet(qry);
 		if (set)
 		{

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


Re: [pgadmin-hackers] patch for cast module

2016-01-19 Thread Sanket Mehta
Hi,

PFA updated patch for cast module as per check list provided by Neel.
Please do review it and let me know in case of anything is missing.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Jan 18, 2016 at 7:16 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi,
>
> PFA patch for cast module.
> Please do review it and let me know in case of any issue.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
new file mode 100644
index 000..3ebc127
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
@@ -0,0 +1,398 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import NodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases as databases
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class CastModule(CollectionNodeModule):
+NODE_TYPE = 'cast'
+COLLECTION_LABEL = 'Casts'
+
+def __init__(self, *args, **kwargs):
+super(CastModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did):
+"""
+Generate the collection node
+"""
+yield self.generate_browser_collection_node(did)
+
+@property
+def script_load(self):
+"""
+Load the module script for server, when any of the server-group node is
+initialized.
+"""
+return databases.DatabaseModule.NODE_TYPE
+
+
+blueprint = CastModule(__name__)
+
+
+class CastView(NodeView):
+node_type = blueprint.node_type
+
+
+parent_ids = [
+{'type': 'int', 'id': 'gid'},
+{'type': 'int', 'id': 'sid'},
+{'type': 'int', 'id': 'did'}
+]
+ids = [
+{'type': 'int', 'id': 'cid'}
+]
+
+operations = dict({
+'obj': [
+{'get': 'properties', 'delete': 'delete', 'put': 'update'},
+{'get': 'list', 'post': 'create'}
+],
+'children': [{
+'get': 'children'
+}],
+'nodes': [{'get': 'node'}, {'get': 'nodes'}],
+'sql': [{'get': 'sql'}],
+'msql': [{'get': 'msql'}, {'get': 'msql'}],
+'stats': [{'get': 'statistics'}],
+'dependency': [{'get': 'dependencies'}],
+'dependent': [{'get': 'dependents'}],
+'module.js': [{}, {}, {'get': 'module_js'}],
+'configs': [{'get': 'configs'}],
+'get_type': [{'get': 'get_sourceTarget_type'}, {'get': 'get_sourceTarget_type'}],
+'getfunctions': [{'post': 'get_functions'}, {'post': 'get_functions'}]
+})
+
+def module_js(self):
+"""
+This property defines (if javascript) exists for this node.
+Override this property for your own logic.
+"""
+return make_response(
+render_template(
+"cast/js/casts.js",
+_=gettext
+),
+200, {'Content-Type': 'application/x-javascript'}
+)
+
+def check_precondition(f):
+"""
+This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+"""
+@wraps(f)
+def wrap(*args, **kwargs):
+# Here args[0] will hold self & kwargs will hold gid,sid,did
+self = args[0]
+self.manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(kwargs['sid'])
+self.conn = self.manager.connection(did=kwargs['did'])
+# If DB not connected then return error to browser
+if not self.conn.connected():
+return precondition_required(
+gettext(
+"Connection to the server has been lost!"
+)
+)
+ver = self.manager.version
+# we will set template path for sql scripts
+if ver >= 9

[pgadmin-hackers] patch for cast module

2016-01-18 Thread Sanket Mehta
Hi,

PFA patch for cast module.
Please do review it and let me know in case of any issue.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
new file mode 100644
index 000..edb937b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py
@@ -0,0 +1,470 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2015, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import NodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases as databases
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class CastModule(CollectionNodeModule):
+NODE_TYPE = 'cast'
+COLLECTION_LABEL = 'Casts'
+
+def __init__(self, *args, **kwargs):
+super(CastModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did):
+"""
+Generate the collection node
+"""
+yield self.generate_browser_collection_node(did)
+
+@property
+def script_load(self):
+"""
+Load the module script for server, when any of the server-group node is
+initialized.
+"""
+return databases.DatabaseModule.NODE_TYPE
+
+
+blueprint = CastModule(__name__)
+
+
+class CastView(NodeView):
+node_type = blueprint.node_type
+
+
+parent_ids = [
+{'type': 'int', 'id': 'gid'},
+{'type': 'int', 'id': 'sid'},
+{'type': 'int', 'id': 'did'}
+]
+ids = [
+{'type': 'int', 'id': 'cid'}
+]
+
+operations = dict({
+'obj': [
+{'get': 'properties', 'delete': 'delete', 'put': 'update'},
+{'get': 'list', 'post': 'create'}
+],
+'children': [{
+'get': 'children'
+}],
+'nodes': [{'get': 'node'}, {'get': 'nodes'}],
+'sql': [{'get': 'sql'}],
+'msql': [{'get': 'msql'}, {'get': 'msql'}],
+'stats': [{'get': 'statistics'}],
+'dependency': [{'get': 'dependencies'}],
+'dependent': [{'get': 'dependents'}],
+'module.js': [{}, {}, {'get': 'module_js'}],
+'configs': [{'get': 'configs'}],
+'get_type': [{'get': 'get_sourceTarget_type'}, {'get': 'get_sourceTarget_type'}],
+'getfunctions': [{'post': 'get_functions'}, {'post': 'get_functions'}]
+})
+
+def module_js(self):
+"""
+This property defines (if javascript) exists for this node.
+Override this property for your own logic.
+"""
+return make_response(
+render_template(
+"cast/js/casts.js",
+_=gettext
+),
+200, {'Content-Type': 'application/x-javascript'}
+)
+
+def check_precondition(f):
+"""
+This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+"""
+@wraps(f)
+def wrap(*args, **kwargs):
+# Here args[0] will hold self & kwargs will hold gid,sid,did
+self = args[0]
+self.manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(kwargs['sid'])
+self.conn = self.manager.connection(did=kwargs['did'])
+# If DB not connected then return error to browser
+if not self.conn.connected():
+return precondition_required(
+gettext(
+"Connection to the server has been lost!"
+)
+)
+ver = self.manager.version
+# we will set template path for sql scripts
+if ver >= 9:
+self.template_path = 'cast/sql/9.0_plus'
+
+return f(*args, **kwargs)
+
+return wrap
+
+
+@check_precondition
+def list(self, gid, sid, did):
+SQL = render_template(
+"/".join([self.template_path, 'properties.sql']),
+datlastsysoid=self.manager.db

[pgadmin-hackers] pgagent job failing to halt on failed step

2015-11-30 Thread Sanket Mehta
Hi,

There is an issue in current pgagent code as explained below:

Issue:
In batch mode if user creates a job with multiple job steps then if first
jobstep gets executed successfully then even if 2nd step is a failure, job
will not halt at that point and will complete its execution. which is not
the expected result.

Analysis:
The main reason for this issue is that in batch mode, when first step is
executed successfully, flag *succeeded *will be set to true, but when the
2nd step gets failed, its not getting reset to false which is why job does
not halt at the same instance and continues executing next steps.

I have resolved this issue and patch is attached with this mail for review.
Please do review the patch and let me know in case anything is missing.
Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/job.cpp b/job.cpp
index f3eaa03..9864f57 100644
--- a/job.cpp
+++ b/job.cpp
@@ -307,9 +307,7 @@ int Job::Execute()
 
 // set success status for batch runs, be pessimistic by default
 LogMessage(wxString::Format(_("Script return code: %d"), rc), LOG_DEBUG);
-if (rc == 0)
-	succeeded = true;
-
+succeeded = ((rc == 0) ? true : false);
 // If output is empty then either script did not return any output
 // or script threw some error into stderr.
 // Check script threw some error into stderr

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


[pgadmin-hackers] PATCH: move object to....(tablespace context)

2015-10-12 Thread Sanket Mehta
Hi Ashesh,

I have created a patch regarding an issue in pgadmin related to tablespace
context.

*Issue:*
While moving Table/Index/materialized view/All to another tablespace,
pgadmin gives error mentioned below:
ERROR: syntax error at or near "MOVE"

*Reason:*
As mentioned in commit id: 3c4cf080879b386d4ed1814667aca025caafe608
in PostgreSQL database, ALTER TABLESPACE src MOVE dest OWNED BY username
syntax has been changed

*Current implementation in postgreSQL db is as below:*
ALTER TABLE/INDEX/MATERIALIZED VIEW ALL IN TABLESPACE src OWNED BY username
SET TABLESPACE dest

*Changes made:*
Changes made to generate sql as per current implementation in PostgreSQL.


Please do review and commit it.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/pgadmin/dlg/dlgMoveTablespace.cpp b/pgadmin/dlg/dlgMoveTablespace.cpp
index cc78a71..677023b 100644
--- a/pgadmin/dlg/dlgMoveTablespace.cpp
+++ b/pgadmin/dlg/dlgMoveTablespace.cpp
@@ -101,15 +101,32 @@ wxString dlgMoveTablespace::GetTablespace()
 wxString dlgMoveTablespace::GetKind()
 {
 	if (cbKind->GetValue().Cmp(_("Tables")) == 0)
-		return wxT("TABLES");
+		return wxT("TABLE");
 	if (cbKind->GetValue().Cmp(_("Indexes")) == 0)
-		return wxT("INDEXES");
+		return wxT("INDEX");
 	if (cbKind->GetValue().Cmp(_("Materialized views")) == 0)
-		return wxT("MATERIALIZED VIEWS");
+		return wxT("MATERIALIZED VIEW");
 
 	return wxT("ALL");
 }
 
+wxArrayString dlgMoveTablespace::GetAllKinds()
+{
+	wxArrayString kinds;
+	for(unsigned int i = 1; i < cbKind->GetCount(); ++i)
+	{
+		if (cbKind->GetString(i).Cmp(_("Tables")) == 0)
+			kinds.Add(wxT("TABLE"));
+		else if (cbKind->GetString(i).Cmp(_("Indexes")) == 0)
+			kinds.Add(wxT("INDEX"));
+		else if (cbKind->GetString(i).Cmp(_("Materialized views")) == 0)
+			kinds.Add(wxT("MATERIALIZED VIEW"));
+		else
+			kinds.Add(cbKind->GetString(i));
+	}
+	return kinds;
+}
+
 wxString dlgMoveTablespace::GetOwner()
 {
 	return cbOwner->GetValue();
diff --git a/pgadmin/include/dlg/dlgMoveTablespace.h b/pgadmin/include/dlg/dlgMoveTablespace.h
index 41f55a6..c749eac 100644
--- a/pgadmin/include/dlg/dlgMoveTablespace.h
+++ b/pgadmin/include/dlg/dlgMoveTablespace.h
@@ -30,7 +30,7 @@ public:
 	wxString GetTablespace();
 	wxString GetKind();
 	wxString GetOwner();
-
+	wxArrayString GetAllKinds();
 private:
 	pgConn *connection;
 	frmMain *parent;
diff --git a/pgadmin/schema/pgTablespace.cpp b/pgadmin/schema/pgTablespace.cpp
index 97d2209..98bf33d 100644
--- a/pgadmin/schema/pgTablespace.cpp
+++ b/pgadmin/schema/pgTablespace.cpp
@@ -253,15 +253,30 @@ void pgTablespace::MoveTablespace(frmMain *form)
 	dlgMoveTablespace rdo(form, GetConnection(), this);
 	if (rdo.ShowModal() != wxID_CANCEL)
 	{
-		if (wxMessageBox(wxString::Format(_("Are you sure you wish to move objects from %s to %s?"), (const char *)GetQuotedFullIdentifier().mb_str(), (const char *)rdo.GetTablespace().mb_str()), _("Move tablespace?"), wxYES_NO) != wxYES)
+		if (wxMessageBox(wxString::Format(_("Are you sure you wish to move objects from %s to %s?"), GetQuotedFullIdentifier().c_str(),rdo.GetTablespace().c_str()), _("Move tablespace?"), wxYES_NO) != wxYES)
 			return;
+		wxString kind = rdo.GetKind();
+		if(kind.compare(wxT("ALL")) != 0)
+		{
+			query = wxT("ALTER ") + kind;
+			query += wxT(" ALL IN TABLESPACE ") + GetQuotedFullIdentifier();
+			if (rdo.GetOwner().Length() > 0)
+query += wxT(" OWNED BY ") + qtIdent(rdo.GetOwner());
+			query += wxT(" SET TABLESPACE ") + qtIdent(rdo.GetTablespace());
+		}
+		else
+		{
+			wxArrayString allKinds = rdo.GetAllKinds();
+			for(size_t index = 0; index < allKinds.GetCount(); ++index)
+			{
+query += wxT("ALTER ") + allKinds.Item(index);
+query += wxT(" ALL IN TABLESPACE ") + GetQuotedFullIdentifier();
+if (rdo.GetOwner().Length() > 0)
+	query += wxT(" OWNED BY ") + qtIdent(rdo.GetOwner());
+query += wxT(" SET TABLESPACE ") + qtIdent(rdo.GetTablespace()) + wxT(";\n");
 
-		query = wxT("ALTER TABLESPACE ") + GetQuotedFullIdentifier();
-		query += wxT(" MOVE ") + rdo.GetKind().Upper();
-		if (rdo.GetOwner().Length() > 0)
-			query += wxT(" OWNED BY ") + qtIdent(rdo.GetOwner());
-		query += wxT(" TO ") + qtIdent(rdo.GetTablespace());
-
+			}
+		}
 		GetConnection()->ExecuteVoid(query);
 	}
 }

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


Re: [pgadmin-hackers] PATCH: move object to....(tablespace context)

2015-10-12 Thread Sanket Mehta
Hi Ashesh,

PFA the updated patch which includes the changes you have suggested.
Please do review and commit it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 12, 2015 at 4:55 PM, Sanket Mehta <sanket.me...@enterprisedb.com
> wrote:

> Hi Ashesh,
>
> I have created a patch regarding an issue in pgadmin related to tablespace
> context.
>
> *Issue:*
> While moving Table/Index/materialized view/All to another tablespace,
> pgadmin gives error mentioned below:
> ERROR: syntax error at or near "MOVE"
>
> *Reason:*
> As mentioned in commit id: 3c4cf080879b386d4ed1814667aca025caafe608
> in PostgreSQL database, ALTER TABLESPACE src MOVE dest OWNED BY username
> syntax has been changed
>
> *Current implementation in postgreSQL db is as below:*
> ALTER TABLE/INDEX/MATERIALIZED VIEW ALL IN TABLESPACE src OWNED BY
> username SET TABLESPACE dest
>
> *Changes made:*
> Changes made to generate sql as per current implementation in PostgreSQL.
>
>
> Please do review and commit it.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
diff --git a/pgadmin/dlg/dlgMoveTablespace.cpp b/pgadmin/dlg/dlgMoveTablespace.cpp
index cc78a71..84fd0d5 100644
--- a/pgadmin/dlg/dlgMoveTablespace.cpp
+++ b/pgadmin/dlg/dlgMoveTablespace.cpp
@@ -98,16 +98,22 @@ wxString dlgMoveTablespace::GetTablespace()
 	return cbMoveTo->GetValue();
 }
 
-wxString dlgMoveTablespace::GetKind()
+wxArrayString dlgMoveTablespace::GetKind()
 {
+	wxArrayString kinds;
 	if (cbKind->GetValue().Cmp(_("Tables")) == 0)
-		return wxT("TABLES");
-	if (cbKind->GetValue().Cmp(_("Indexes")) == 0)
-		return wxT("INDEXES");
-	if (cbKind->GetValue().Cmp(_("Materialized views")) == 0)
-		return wxT("MATERIALIZED VIEWS");
-
-	return wxT("ALL");
+		kinds.Add(wxT("TABLE"));
+	else if (cbKind->GetValue().Cmp(_("Indexes")) == 0)
+		kinds.Add(wxT("INDEX"));
+	else if (cbKind->GetValue().Cmp(_("Materialized views")) == 0)
+		kinds.Add(wxT("MATERIALIZED VIEW"));
+	else
+	{
+		kinds.Add(wxT("TABLE"));
+		kinds.Add(wxT("INDEX"));
+		kinds.Add(wxT("MATERIALIZED VIEW"));
+	}
+	return kinds;
 }
 
 wxString dlgMoveTablespace::GetOwner()
diff --git a/pgadmin/include/dlg/dlgMoveTablespace.h b/pgadmin/include/dlg/dlgMoveTablespace.h
index 41f55a6..d8a9451 100644
--- a/pgadmin/include/dlg/dlgMoveTablespace.h
+++ b/pgadmin/include/dlg/dlgMoveTablespace.h
@@ -28,9 +28,8 @@ public:
 	dlgMoveTablespace(frmMain *win, pgConn *conn, pgTablespace *tblspc);
 	~dlgMoveTablespace();
 	wxString GetTablespace();
-	wxString GetKind();
+	wxArrayString GetKind();
 	wxString GetOwner();
-
 private:
 	pgConn *connection;
 	frmMain *parent;
diff --git a/pgadmin/schema/pgTablespace.cpp b/pgadmin/schema/pgTablespace.cpp
index 97d2209..346c39f 100644
--- a/pgadmin/schema/pgTablespace.cpp
+++ b/pgadmin/schema/pgTablespace.cpp
@@ -253,15 +253,34 @@ void pgTablespace::MoveTablespace(frmMain *form)
 	dlgMoveTablespace rdo(form, GetConnection(), this);
 	if (rdo.ShowModal() != wxID_CANCEL)
 	{
-		if (wxMessageBox(wxString::Format(_("Are you sure you wish to move objects from %s to %s?"), (const char *)GetQuotedFullIdentifier().mb_str(), (const char *)rdo.GetTablespace().mb_str()), _("Move tablespace?"), wxYES_NO) != wxYES)
+		if (wxMessageBox(wxString::Format(
+			_("Are you sure you wish to move objects from %s to %s?"),
+			GetQuotedFullIdentifier().c_str(),rdo.GetTablespace().c_str()),
+			_("Move tablespace?"),
+			wxYES_NO) != wxYES)
 			return;
 
-		query = wxT("ALTER TABLESPACE ") + GetQuotedFullIdentifier();
-		query += wxT(" MOVE ") + rdo.GetKind().Upper();
+		wxArrayString kind = rdo.GetKind();
+		wxString  ownerInfo,
+		  moveTo = qtIdent(rdo.GetTablespace()),
+			  currTblSpace = GetQuotedFullIdentifier();
+
 		if (rdo.GetOwner().Length() > 0)
-			query += wxT(" OWNED BY ") + qtIdent(rdo.GetOwner());
-		query += wxT(" TO ") + qtIdent(rdo.GetTablespace());
+		{
+			ownerInfo = wxString::Format(
+wxT(" OWNED BY %s"),
+qtIdent(rdo.GetOwner()).c_str());
+		}
 
+		for(size_t index = 0; index < kind.GetCount(); ++index)
+		{
+			query += wxString::Format(
+wxT("ALTER %s ALL IN TABLESPACE %s%s SET TABLESPACE %s;\n"),
+kind.Item(index).c_str(),
+currTblSpace.c_str(),
+ownerInfo.c_str(),
+moveTo.c_str());
+		}
 		GetConnection()->ExecuteVoid(query);
 	}
 }

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


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action version 2

2015-09-23 Thread Sanket Mehta
Hi John/Ashesh,

I have reviewed the patch and it seems fine to me.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Sep 23, 2015 at 11:08 AM, John Obaterspok <john.obaters...@gmail.com
> wrote:

> Hi Sanket,
>
> Did you give the patch a try? I would really like it to for the next
> release :)
>
> -- john
>
> 2015-09-16 20:27 GMT+02:00 John Obaterspok <john.obaters...@gmail.com>:
>
>> Hi Sanket,
>>
>> Attached patch is rebased now.
>>
>> Regards,
>>
>> -- john
>>
>>
>> 2015-09-16 11:20 GMT+02:00 Sanket Mehta <sanket.me...@enterprisedb.com>:
>>
>>> Hi John,
>>>
>>> Patch is not proper.
>>> I got below error when I try to apply the patch:
>>>
>>> error: patch failed: pgadmin/frm/frmQuery.cpp:2435
>>> error: pgadmin/frm/frmQuery.cpp: patch does not apply
>>>
>>> Please do provide the proper patch.
>>>
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Mon, Sep 14, 2015 at 10:51 AM, Sanket Mehta <
>>> sanket.me...@enterprisedb.com> wrote:
>>>
>>>> Sure Ashesh,
>>>>
>>>> I will review the patch.
>>>>
>>>> Regards,
>>>> Sanket Mehta
>>>> Sr Software engineer
>>>> Enterprisedb
>>>>
>>>> On Mon, Sep 14, 2015 at 1:12 PM, Ashesh Vashi <
>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>
>>>>> Sanket,
>>>>>
>>>>> Can you please take a look at it?
>>>>>
>>>>> --
>>>>>
>>>>> Thanks & Regards,
>>>>>
>>>>> Ashesh Vashi
>>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>>> <http://www.enterprisedb.com>
>>>>>
>>>>>
>>>>> *http://www.linkedin.com/in/asheshvashi*
>>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>>
>>>>> On Mon, Sep 14, 2015 at 1:07 AM, John Obaterspok <
>>>>> john.obaters...@gmail.com> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm updated the patch to add commit/rollback actions in the toolbar
>>>>>> with the following:
>>>>>> 1) updated icons (based on existing pgadmin icon with arrows drawn by
>>>>>> me)
>>>>>> 2) add entry to menu as well
>>>>>> 3) disable icons when not in a transaction
>>>>>> 4) Ctrl+Shift C|R shortcut
>>>>>>
>>>>>> Hopefully all issues are resolved now!
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>   John
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org
>>>>>> )
>>>>>> To make changes to your subscription:
>>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action version 2

2015-09-16 Thread Sanket Mehta
Hi John,

Patch is not proper.
I got below error when I try to apply the patch:

error: patch failed: pgadmin/frm/frmQuery.cpp:2435
error: pgadmin/frm/frmQuery.cpp: patch does not apply

Please do provide the proper patch.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Sep 14, 2015 at 10:51 AM, Sanket Mehta <
sanket.me...@enterprisedb.com> wrote:

> Sure Ashesh,
>
> I will review the patch.
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Mon, Sep 14, 2015 at 1:12 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Sanket,
>>
>> Can you please take a look at it?
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> <http://www.enterprisedb.com>
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> <http://www.linkedin.com/in/asheshvashi>
>>
>> On Mon, Sep 14, 2015 at 1:07 AM, John Obaterspok <
>> john.obaters...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I'm updated the patch to add commit/rollback actions in the toolbar with
>>> the following:
>>> 1) updated icons (based on existing pgadmin icon with arrows drawn by me)
>>> 2) add entry to menu as well
>>> 3) disable icons when not in a transaction
>>> 4) Ctrl+Shift C|R shortcut
>>>
>>> Hopefully all issues are resolved now!
>>>
>>> Regards,
>>>
>>>   John
>>>
>>>
>>>
>>> --
>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>
>>>
>>
>


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action version 2

2015-09-14 Thread Sanket Mehta
Sure Ashesh,

I will review the patch.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Sep 14, 2015 at 1:12 PM, Ashesh Vashi <ashesh.va...@enterprisedb.com
> wrote:

> Sanket,
>
> Can you please take a look at it?
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> <http://www.enterprisedb.com>
>
>
> *http://www.linkedin.com/in/asheshvashi*
> <http://www.linkedin.com/in/asheshvashi>
>
> On Mon, Sep 14, 2015 at 1:07 AM, John Obaterspok <
> john.obaters...@gmail.com> wrote:
>
>> Hello,
>>
>> I'm updated the patch to add commit/rollback actions in the toolbar with
>> the following:
>> 1) updated icons (based on existing pgadmin icon with arrows drawn by me)
>> 2) add entry to menu as well
>> 3) disable icons when not in a transaction
>> 4) Ctrl+Shift C|R shortcut
>>
>> Hopefully all issues are resolved now!
>>
>> Regards,
>>
>>   John
>>
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>


Re: [pgadmin-hackers] PATCH: improve sorting in the Data Editor

2015-08-06 Thread Sanket Mehta
Hi,

In this case patch looks good to me.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Aug 6, 2015 at 2:22 PM, Dave Page dp...@pgadmin.org wrote:



 On Wed, Aug 5, 2015 at 6:20 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I have reviewed the patch and below is analysis.

 - Behaviour of sorting in data editor before applying the patch is as
 below:

 By default table is sorted by PK/OID in ascending order.
 when user select any other column to sort the table, that column gets the
 second priority for sorting the table like i.e.order by col_pk, col_column1
 where col_pk is column having PK and col_column1 is any other ordinary
 column.

 - below is the behaviour I have found after applying the patch:

 By default table is sorted by PK/OID in ascending order.
 When user selects any other column default sorting is removed and table
 is getting sorted by newly selected column.
 But after this if user wants to sort the table by PK or any other column
 it will have the same behaviour like it has before applying the patch. i.e.
 order by col_column1, col_PK where col_column1 and col_PK are same as
 explained above. It will not sort the table by newly selected
 column(col_PK) because sorting of older column(col_column1) is still in
 effect and has the higher priority.

 This will also confuse the user.

 So according to me current behaviour of sorting of table data in pgadmin
 is acceptable.

 Dave,
 Do you have any other thoughts on it?


 I think J.F's patch makes sense. It is a little more complex logically
 speaking, but I also think it's more likely what the user would expect to
 happen.




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Aug 3, 2015 at 11:07 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Ashesh.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Aug 3, 2015 at 10:49 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sanket,

 Can you please review it?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Sun, Aug 2, 2015 at 3:49 PM, J.F. Oster jinfros...@mail.ru wrote:

 Hello,

 Here is a small improvement about sorting in the Data editor.

 Problem:
 If a table has a PK or OIDs, it gets sorted by PK/OID by default.
 When a user wants to sort by any other column, he has first to click
 Remove sort in the context menu, and only then click Sort
 ascending(descending) on column of his choice.

 If he doesn't remove the default sort, he will get no effect and
 probably be puzzled for the first time until guesses that he makes
   ORDER BY column_pk, column_of_choice
 which is totally useless.
 The need to Remove sort each time is annoying.

 Solution:
 When a user chooses to sort by some column, we must discard the
 default sort order.

 Please see the attached patch.
 Thanks.

 --
 Best regards,
  J.F.

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







 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company



Re: [pgadmin-hackers] PATCH: improve sorting in the Data Editor

2015-08-05 Thread Sanket Mehta
Hi,

I have reviewed the patch and below is analysis.

- Behaviour of sorting in data editor before applying the patch is as below:

By default table is sorted by PK/OID in ascending order.
when user select any other column to sort the table, that column gets the
second priority for sorting the table like i.e.order by col_pk, col_column1
where col_pk is column having PK and col_column1 is any other ordinary
column.

- below is the behaviour I have found after applying the patch:

By default table is sorted by PK/OID in ascending order.
When user selects any other column default sorting is removed and table is
getting sorted by newly selected column.
But after this if user wants to sort the table by PK or any other column it
will have the same behaviour like it has before applying the patch. i.e.
order by col_column1, col_PK where col_column1 and col_PK are same as
explained above. It will not sort the table by newly selected
column(col_PK) because sorting of older column(col_column1) is still in
effect and has the higher priority.

This will also confuse the user.

So according to me current behaviour of sorting of table data in pgadmin is
acceptable.

Dave,
Do you have any other thoughts on it?


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Aug 3, 2015 at 11:07 AM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Sure Ashesh.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Aug 3, 2015 at 10:49 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sanket,

 Can you please review it?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Sun, Aug 2, 2015 at 3:49 PM, J.F. Oster jinfros...@mail.ru wrote:

 Hello,

 Here is a small improvement about sorting in the Data editor.

 Problem:
 If a table has a PK or OIDs, it gets sorted by PK/OID by default.
 When a user wants to sort by any other column, he has first to click
 Remove sort in the context menu, and only then click Sort
 ascending(descending) on column of his choice.

 If he doesn't remove the default sort, he will get no effect and
 probably be puzzled for the first time until guesses that he makes
   ORDER BY column_pk, column_of_choice
 which is totally useless.
 The need to Remove sort each time is annoying.

 Solution:
 When a user chooses to sort by some column, we must discard the
 default sort order.

 Please see the attached patch.
 Thanks.

 --
 Best regards,
  J.F.

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






Re: [pgadmin-hackers] PATCH: improve sorting in the Data Editor

2015-08-02 Thread Sanket Mehta
Sure Ashesh.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Aug 3, 2015 at 10:49 AM, Ashesh Vashi ashesh.va...@enterprisedb.com
 wrote:

 Sanket,

 Can you please review it?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Sun, Aug 2, 2015 at 3:49 PM, J.F. Oster jinfros...@mail.ru wrote:

 Hello,

 Here is a small improvement about sorting in the Data editor.

 Problem:
 If a table has a PK or OIDs, it gets sorted by PK/OID by default.
 When a user wants to sort by any other column, he has first to click
 Remove sort in the context menu, and only then click Sort
 ascending(descending) on column of his choice.

 If he doesn't remove the default sort, he will get no effect and
 probably be puzzled for the first time until guesses that he makes
   ORDER BY column_pk, column_of_choice
 which is totally useless.
 The need to Remove sort each time is annoying.

 Solution:
 When a user chooses to sort by some column, we must discard the
 default sort order.

 Please see the attached patch.
 Thanks.

 --
 Best regards,
  J.F.

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





Re: [pgadmin-hackers] PATCH: fix typos

2015-07-06 Thread Sanket Mehta
Hi,

I have reviewed the patch.
It looks good to me.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Sat, Jul 4, 2015 at 3:22 PM, Dmitriy Olshevskiy olshevski...@bk.ru
wrote:

 hello. could you see this patch with several typos in comments and
 messages?

 --
 Dmitriy Olshevskiy



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




Re: [pgadmin-hackers] PATCH: fix size check in dlgProperty

2015-07-06 Thread Sanket Mehta
Hi,

Patch looks good to me.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Sat, Jul 4, 2015 at 4:07 PM, Dmitriy Olshevskiy olshevski...@bk.ru
wrote:

  hello again.
 method dlgDefaultSecurityProperty::OnChangeSize contains the repeated
 expressions with l_size.GetWidth() in the conditional operator. I guess
 the second
 expression must by l_size.GetHeight()  25.
 I have attached the file with the correction. could you review it?
 thank you.

 --
 Dmitriy Olshevskiy



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




Re: [pgadmin-hackers] An error occurredColumn not found in pgSet: rolcateupdate when connect to PostgreSQL 9.5 server

2015-07-03 Thread Sanket Mehta
Hi Ashesh,

In previous patch there was a error in pgRole.cpp that in case of pg 9.5
while deleting the user role, it will not prompt the warning message to
user.
I have resolved the issue and attached the patch with this mail for the
same.
Please do check it and let me know if anything else is missing.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Jul 1, 2015 at 8:47 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh, can you review/commit please?

 Thanks.

 On Tue, Jun 30, 2015 at 2:27 PM, Sanket Mehta
 sanket.me...@enterprisedb.com wrote:
  Hi,
 
 
  While connecting to PostgreSQL 9.5 serve using pgadmin, we have faced an
  error column not found in pgSet: tolcatupdate.
 
  We have resolved this issue and the patch is attached to this mail.
  Please do review it and let me know if any thing is missing.
 
 
  Regards,
  Sanket Mehta
  Sr Software engineer
  Enterprisedb
 
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

diff --git a/pgadmin/dlg/dlgRole.cpp b/pgadmin/dlg/dlgRole.cpp
index 9b4d2b2..a3d7515 100644
--- a/pgadmin/dlg/dlgRole.cpp
+++ b/pgadmin/dlg/dlgRole.cpp
@@ -219,7 +219,10 @@ int dlgRole::Go(bool modal)
 		chkCreateRole-SetValue(role-GetCreateRole());
 		chkSuperuser-SetValue(role-GetSuperuser());
 		chkInherits-SetValue(role-GetInherits());
-		chkUpdateCat-SetValue(role-GetUpdateCatalog());
+		if (!connection-BackendMinimumVersion(9, 5))
+			chkUpdateCat-SetValue(role-GetUpdateCatalog());
+		else
+			chkUpdateCat-Disable();
 		chkCanLogin-SetValue(role-GetCanLogin());
 		chkReplication-SetValue(role-GetReplication());
 		if (role-GetAccountExpires().IsValid()  role-GetAccountExpires().GetValue() != -1)
@@ -385,7 +388,8 @@ void dlgRole::OnChangeSuperuser(wxCommandEvent ev)
 			return;
 		}
 	}
-	chkUpdateCat-SetValue(chkSuperuser-GetValue());
+	chkUpdateCat-SetValue(chkSuperuser-GetValue() 
+		!connection-BackendMinimumVersion(9, 5));
 	CheckChange();
 }
 
@@ -403,7 +407,8 @@ void dlgRole::CheckChange()
 		timValidUntil-SetTime(wxDefaultDateTime);
 
 	if (!readOnly)
-		chkUpdateCat-Enable(chkSuperuser-GetValue());
+		chkUpdateCat-Enable(chkSuperuser-GetValue() 
+			!connection-BackendMinimumVersion(9, 5));
 
 	// Check the passwords match
 	if (txtPasswd-GetValue() != txtRePasswd-GetValue())
@@ -693,7 +698,8 @@ wxString dlgRole::GetSql()
 		if (!options.IsNull())
 			sql += wxT(ALTER ROLE ) + qtIdent(name) + options + wxT(;\n);
 
-		if (chkUpdateCat-GetValue() != role-GetUpdateCatalog())
+		if (!connection-BackendMinimumVersion(9, 5) 
+chkUpdateCat-GetValue() != role-GetUpdateCatalog())
 		{
 			if (!connection-HasPrivilege(wxT(Table), wxT(pg_authid), wxT(update)))
 sql += wxT( -- Can't update 'UpdateCatalog privilege: can't write to pg_authid.\n)
@@ -827,7 +833,8 @@ wxString dlgRole::GetSql()
 		}
 		sql += wxT(;\n) + grants;
 
-		if (superuser  !chkUpdateCat-GetValue())
+		if (superuser  !chkUpdateCat-GetValue() 
+			!connection-BackendMinimumVersion(9, 5))
 			sql += wxT(UPDATE pg_authid SET rolcatupdate=false WHERE rolname=) + qtDbString(name) + wxT(;\n);
 	}
 
diff --git a/pgadmin/schema/pgRole.cpp b/pgadmin/schema/pgRole.cpp
index f9189c5..70ecd24 100644
--- a/pgadmin/schema/pgRole.cpp
+++ b/pgadmin/schema/pgRole.cpp
@@ -177,7 +177,8 @@ int pgRole::GetIconId()
 
 bool pgRole::DropObject(wxFrame *frame, ctlTree *browser, bool cascaded)
 {
-	if (GetUpdateCatalog())
+	if ((GetUpdateCatalog()  !server-GetConnection()-BackendMinimumVersion(9, 5)) ||
+		(server-GetConnection()-BackendMinimumVersion(9, 5)  this-GetSuperuser()))
 	{
 		wxMessageDialog dlg(frame,
 		_(Deleting a superuser might result in unwanted behaviour (e.g. when restoring the database).\nAre you sure?),
@@ -226,7 +227,8 @@ wxString pgRole::GetSql(ctlTree *browser)
 			AppendIfFilled(sql, wxT( RESOURCE QUEUE ), GetRolQueueName());
 		sql += wxT(;\n);
 
-		if (this-GetSuperuser()  !GetUpdateCatalog())
+		if (this-GetSuperuser()  !GetUpdateCatalog() 
+			!server-GetConnection()-BackendMinimumVersion(9, 5))
 			sql += wxT(UPDATE pg_authid SET rolcatupdate=false WHERE rolname=) + qtDbString(GetIdentifier()) + wxT(;\n);
 
 		size_t index;
@@ -458,7 +460,9 @@ void pgRole::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *proper
 		properties-AppendItem(_(Superuser?), BoolToYesNo(GetSuperuser()));
 		properties-AppendItem(_(Create databases?), BoolToYesNo(GetCreateDatabase()));
 		properties-AppendItem(_(Create roles?), BoolToYesNo(GetCreateRole()));
-		properties-AppendItem(_(Update catalogs?), BoolToYesNo(GetUpdateCatalog()));
+
+		if (!server-GetConnection()-BackendMinimumVersion(9, 5))
+			properties-AppendItem(_(Update catalogs?), BoolToYesNo(GetUpdateCatalog()));
 		properties-AppendItem

[pgadmin-hackers] An error occurredColumn not found in pgSet: rolcateupdate when connect to PostgreSQL 9.5 server

2015-06-30 Thread Sanket Mehta
Hi,


While connecting to PostgreSQL 9.5 serve using pgadmin, we have faced an
error column not found in pgSet: tolcatupdate.

We have resolved this issue and the patch is attached to this mail.
Please do review it and let me know if any thing is missing.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/pgadmin/dlg/dlgRole.cpp b/pgadmin/dlg/dlgRole.cpp
index 9b4d2b2..a3d7515 100644
--- a/pgadmin/dlg/dlgRole.cpp
+++ b/pgadmin/dlg/dlgRole.cpp
@@ -219,7 +219,10 @@ int dlgRole::Go(bool modal)
 		chkCreateRole-SetValue(role-GetCreateRole());
 		chkSuperuser-SetValue(role-GetSuperuser());
 		chkInherits-SetValue(role-GetInherits());
-		chkUpdateCat-SetValue(role-GetUpdateCatalog());
+		if (!connection-BackendMinimumVersion(9, 5))
+			chkUpdateCat-SetValue(role-GetUpdateCatalog());
+		else
+			chkUpdateCat-Disable();
 		chkCanLogin-SetValue(role-GetCanLogin());
 		chkReplication-SetValue(role-GetReplication());
 		if (role-GetAccountExpires().IsValid()  role-GetAccountExpires().GetValue() != -1)
@@ -385,7 +388,8 @@ void dlgRole::OnChangeSuperuser(wxCommandEvent ev)
 			return;
 		}
 	}
-	chkUpdateCat-SetValue(chkSuperuser-GetValue());
+	chkUpdateCat-SetValue(chkSuperuser-GetValue() 
+		!connection-BackendMinimumVersion(9, 5));
 	CheckChange();
 }
 
@@ -403,7 +407,8 @@ void dlgRole::CheckChange()
 		timValidUntil-SetTime(wxDefaultDateTime);
 
 	if (!readOnly)
-		chkUpdateCat-Enable(chkSuperuser-GetValue());
+		chkUpdateCat-Enable(chkSuperuser-GetValue() 
+			!connection-BackendMinimumVersion(9, 5));
 
 	// Check the passwords match
 	if (txtPasswd-GetValue() != txtRePasswd-GetValue())
@@ -693,7 +698,8 @@ wxString dlgRole::GetSql()
 		if (!options.IsNull())
 			sql += wxT(ALTER ROLE ) + qtIdent(name) + options + wxT(;\n);
 
-		if (chkUpdateCat-GetValue() != role-GetUpdateCatalog())
+		if (!connection-BackendMinimumVersion(9, 5) 
+chkUpdateCat-GetValue() != role-GetUpdateCatalog())
 		{
 			if (!connection-HasPrivilege(wxT(Table), wxT(pg_authid), wxT(update)))
 sql += wxT( -- Can't update 'UpdateCatalog privilege: can't write to pg_authid.\n)
@@ -827,7 +833,8 @@ wxString dlgRole::GetSql()
 		}
 		sql += wxT(;\n) + grants;
 
-		if (superuser  !chkUpdateCat-GetValue())
+		if (superuser  !chkUpdateCat-GetValue() 
+			!connection-BackendMinimumVersion(9, 5))
 			sql += wxT(UPDATE pg_authid SET rolcatupdate=false WHERE rolname=) + qtDbString(name) + wxT(;\n);
 	}
 
diff --git a/pgadmin/schema/pgRole.cpp b/pgadmin/schema/pgRole.cpp
index f9189c5..402582d 100644
--- a/pgadmin/schema/pgRole.cpp
+++ b/pgadmin/schema/pgRole.cpp
@@ -177,7 +177,8 @@ int pgRole::GetIconId()
 
 bool pgRole::DropObject(wxFrame *frame, ctlTree *browser, bool cascaded)
 {
-	if (GetUpdateCatalog())
+	if (GetUpdateCatalog() 
+			!server-GetConnection()-BackendMinimumVersion(9, 5))
 	{
 		wxMessageDialog dlg(frame,
 		_(Deleting a superuser might result in unwanted behaviour (e.g. when restoring the database).\nAre you sure?),
@@ -226,7 +227,8 @@ wxString pgRole::GetSql(ctlTree *browser)
 			AppendIfFilled(sql, wxT( RESOURCE QUEUE ), GetRolQueueName());
 		sql += wxT(;\n);
 
-		if (this-GetSuperuser()  !GetUpdateCatalog())
+		if (this-GetSuperuser()  !GetUpdateCatalog() 
+			!server-GetConnection()-BackendMinimumVersion(9, 5))
 			sql += wxT(UPDATE pg_authid SET rolcatupdate=false WHERE rolname=) + qtDbString(GetIdentifier()) + wxT(;\n);
 
 		size_t index;
@@ -458,7 +460,9 @@ void pgRole::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *proper
 		properties-AppendItem(_(Superuser?), BoolToYesNo(GetSuperuser()));
 		properties-AppendItem(_(Create databases?), BoolToYesNo(GetCreateDatabase()));
 		properties-AppendItem(_(Create roles?), BoolToYesNo(GetCreateRole()));
-		properties-AppendItem(_(Update catalogs?), BoolToYesNo(GetUpdateCatalog()));
+
+		if (!server-GetConnection()-BackendMinimumVersion(9, 5))
+			properties-AppendItem(_(Update catalogs?), BoolToYesNo(GetUpdateCatalog()));
 		properties-AppendItem(_(Inherits?), BoolToYesNo(GetInherits()));
 		if (server-GetConnection()-BackendMinimumVersion(9, 1))
 		{
@@ -641,7 +645,9 @@ pgObject *pgRoleBaseFactory::CreateObjects(pgCollection *collection, ctlTree *br
 			role-iSetCreateRole(roles-GetBool(wxT(rolcreaterole)));
 			role-iSetCreateDatabase(roles-GetBool(wxT(rolcreatedb)));
 			role-iSetSuperuser(roles-GetBool(wxT(rolsuper)));
-			role-iSetUpdateCatalog(roles-GetBool(wxT(rolcatupdate)));
+
+			if (!collection-GetServer()-GetConnection()-BackendMinimumVersion(9, 5))
+role-iSetUpdateCatalog(roles-GetBool(wxT(rolcatupdate)));
 			role-iSetAccountExpires(roles-GetDateTime(wxT(rolvaliduntil)));
 			role-iSetIsValidInfinity(roles-GetVal(wxT(rolvaliduntil)) == wxT(infinity) ? true : false);
 			role-iSetPassword(roles-GetVal(wxT(rolpassword)));

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


Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-29 Thread Sanket Mehta
Hi John,

PFA the new patch.
Please check and let me know if it still crashes.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Jun 23, 2015 at 12:03 AM, John Obaterspok john.obaters...@gmail.com
 wrote:

 Hello,

 It still crashes on the wxIsalpha. Uncommenting the /* (size_t)wordlen 
 queryLen  */ makes it not crash.

 -- john

 2015-06-18 11:24 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 we had found some other issues in autocommit code and resolved it.
 Here is the patch attached with this mail.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 12:59 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello,

 I forgot to mention that yesterday I did a search for GetChar() and
 there was another place that also checked the length prior to calling
 GetChar(). But perhaps that case was different.

 Might be wx 3 related. (It has works fine except for an assert that pops
 up after connecting to a db + the GetChar() issue)

 -- john

 2015-06-16 8:40 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 We were using wxWidgets 2.8.12 so that may be the issue.
 I will now try with wxwidgets 3.0.2 and let you know.

 Btw apart from this issue, we have also resolved other issues in the
 code, i will soon send a new patch for the same.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Jun 15, 2015 at 11:33 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 I'm using Visual Studio 2010 on Windows 7 x64. wxWidgets
 is wxMSW-3.0.2.
 It might be an assert that triggers in wxwidgets, but ignoring it just
 causes pgadmin to terminate.

 -- john

 2015-06-14 18:44 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com
 :

 John,

 As I understand correctly, 8th character will be '\0' (null
 character). Hence - wxIsAlpha() will come out of the loop in general.

 But - it is possible every platform has different behaviour for
 wxWidgets. Can you please be specific about the operating system?

 --
 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB (Software Architect)

 [Sent through mobile]
 On Jun 14, 2015 2:41 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi John,

 I have tried the same, I am not getting any out of the bounds error,
 it simply comes out of the while loop.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Sun, Jun 14, 2015 at 2:00 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello Sanket,

 Just enter rollback and exec

 The
  while(wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

 As the 'k' in rollback is a char it also tries the next character
 (worklen = 8) which causes out of bounds check.

 -- john


 2015-06-12 13:25 GMT+02:00 Sanket Mehta 
 sanket.me...@enterprisedb.com:

 Hi John,

 I have tried to reproduce the scenario but not able to reproduce
 the crash in my system.
 can you please provide your steps which causes crash on your
 machine?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will
 send the patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString
 query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length() 
 wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*













fix_autocommitv2.patch
Description: Binary data

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


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action

2015-06-24 Thread Sanket Mehta
Hi John,

are you sending any other icons for the same?

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Jun 23, 2015 at 1:47 PM, Dave Page dp...@pgadmin.org wrote:

 Hi

 On Mon, Jun 22, 2015 at 2:02 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Dave,

 Regarding I don't think there is..., was it the width, style or
 something else that you didn't like? The total width with commit/rollback
 icon + the connection drop down is less than 790 px.
 I've changed the arrows so they point to the data store icon (ie commit)
 and from the data store (rollback).


 It's the overall width of the window. I just measured it on OS X here, and
 it's currently ~740px, so two more buttons shouldn't be an issue. I don't
 think we want any more though.



 I could change it to only show the icons when using auto commit off.
 Would that be better?


 No, the buttons should always be visible to avoid user confusion.



 -- john

 2015-06-19 14:24 GMT+02:00 Dave Page dp...@pgadmin.org:

 Just that whatever we add needs to match the style of what's there
 already, and it should convey the purpose of the buttons as clearly as
 possible. Finally, we only add them if there's physical room when
 displaying the window on a screen of ~1000px wide. Personally, I don't
 think there is...

 On Fri, Jun 19, 2015 at 1:38 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Dave,

 Do you have any comments on the same?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Wed, Jun 17, 2015 at 5:52 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Thanks,

 I can try to look at disabling when not in transaction mode + the
 short cuts.

 Regarding the icons, toad for oracle uses a database icon which the
 arrows point to/from. Perhaps we should add something *similar*?

 [image: Infogad bild 1]

 -- john

 2015-06-17 13:44 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com
 :

 Hi John,

 I have applied the patch and below are my suggestions:

 1. Rollback and commit icons should be disabled session is not in
 transaction mode
 2. Rollback and Commit should also be included in Query menu and
 individual short cut should be assigned to them.

 Dave,

 Can we have any other icons for both the functionality as these icons
 looks odd to me.



 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 5:03 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Dave.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 4:55 PM, Dave Page dp...@pgadmin.org
 wrote:

 Sanket, can you look at this please?

 Sent from my iPad

  On 15 Jun 2015, at 16:33, John Obaterspok 
 john.obaters...@gmail.com wrote:
 
  Hello,
 
  With the newly added option to disable auto commit (hurray) I
 really missed commit/rollback toolbar buttons. Attached patch adds 
 this.
 
  -- john
 
  0001-Add-Commit-Rollback-toolbar-action.patch
 
  --
  Sent via pgadmin-hackers mailing list (
 pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers








 --
 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



Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-18 Thread Sanket Mehta
Hi,

we had found some other issues in autocommit code and resolved it.
Here is the patch attached with this mail.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Jun 16, 2015 at 12:59 PM, John Obaterspok john.obaters...@gmail.com
 wrote:

 Hello,

 I forgot to mention that yesterday I did a search for GetChar() and there
 was another place that also checked the length prior to calling GetChar().
 But perhaps that case was different.

 Might be wx 3 related. (It has works fine except for an assert that pops
 up after connecting to a db + the GetChar() issue)

 -- john

 2015-06-16 8:40 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 We were using wxWidgets 2.8.12 so that may be the issue.
 I will now try with wxwidgets 3.0.2 and let you know.

 Btw apart from this issue, we have also resolved other issues in the
 code, i will soon send a new patch for the same.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Jun 15, 2015 at 11:33 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 I'm using Visual Studio 2010 on Windows 7 x64. wxWidgets is wxMSW-3.0.2.
 It might be an assert that triggers in wxwidgets, but ignoring it just
 causes pgadmin to terminate.

 -- john

 2015-06-14 18:44 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com:

 John,

 As I understand correctly, 8th character will be '\0' (null character).
 Hence - wxIsAlpha() will come out of the loop in general.

 But - it is possible every platform has different behaviour for
 wxWidgets. Can you please be specific about the operating system?

 --
 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB (Software Architect)

 [Sent through mobile]
 On Jun 14, 2015 2:41 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi John,

 I have tried the same, I am not getting any out of the bounds error,
 it simply comes out of the while loop.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Sun, Jun 14, 2015 at 2:00 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello Sanket,

 Just enter rollback and exec

 The
  while(wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

 As the 'k' in rollback is a char it also tries the next character
 (worklen = 8) which causes out of bounds check.

 -- john


 2015-06-12 13:25 GMT+02:00 Sanket Mehta 
 sanket.me...@enterprisedb.com:

 Hi John,

 I have tried to reproduce the scenario but not able to reproduce the
 crash in my system.
 can you please provide your steps which causes crash on your machine?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will
 send the patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString
 query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length() 
 wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*











fix_autocommit.patch
Description: Binary data

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


Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-16 Thread Sanket Mehta
Hi,

We were using wxWidgets 2.8.12 so that may be the issue.
I will now try with wxwidgets 3.0.2 and let you know.

Btw apart from this issue, we have also resolved other issues in the code,
i will soon send a new patch for the same.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Jun 15, 2015 at 11:33 PM, John Obaterspok john.obaters...@gmail.com
 wrote:

 I'm using Visual Studio 2010 on Windows 7 x64. wxWidgets is wxMSW-3.0.2.
 It might be an assert that triggers in wxwidgets, but ignoring it just
 causes pgadmin to terminate.

 -- john

 2015-06-14 18:44 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com:

 John,

 As I understand correctly, 8th character will be '\0' (null character).
 Hence - wxIsAlpha() will come out of the loop in general.

 But - it is possible every platform has different behaviour for
 wxWidgets. Can you please be specific about the operating system?

 --
 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB (Software Architect)

 [Sent through mobile]
 On Jun 14, 2015 2:41 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi John,

 I have tried the same, I am not getting any out of the bounds error, it
 simply comes out of the while loop.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Sun, Jun 14, 2015 at 2:00 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello Sanket,

 Just enter rollback and exec

 The
  while(wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

 As the 'k' in rollback is a char it also tries the next character
 (worklen = 8) which causes out of bounds check.

 -- john


 2015-06-12 13:25 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com
 :

 Hi John,

 I have tried to reproduce the scenario but not able to reproduce the
 crash in my system.
 can you please provide your steps which causes crash on your machine?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will send
 the patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString
 query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length() 
 wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*









Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action

2015-06-16 Thread Sanket Mehta
Sure Dave.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Jun 16, 2015 at 4:55 PM, Dave Page dp...@pgadmin.org wrote:

 Sanket, can you look at this please?

 Sent from my iPad

  On 15 Jun 2015, at 16:33, John Obaterspok john.obaters...@gmail.com
 wrote:
 
  Hello,
 
  With the newly added option to disable auto commit (hurray) I really
 missed commit/rollback toolbar buttons. Attached patch adds this.
 
  -- john
 
  0001-Add-Commit-Rollback-toolbar-action.patch
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers



Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-14 Thread Sanket Mehta
Hi John,

I have tried the same, I am not getting any out of the bounds error, it
simply comes out of the while loop.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Sun, Jun 14, 2015 at 2:00 PM, John Obaterspok john.obaters...@gmail.com
wrote:

 Hello Sanket,

 Just enter rollback and exec

 The
  while(wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

 As the 'k' in rollback is a char it also tries the next character (worklen
 = 8) which causes out of bounds check.

 -- john


 2015-06-12 13:25 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi John,

 I have tried to reproduce the scenario but not able to reproduce the
 crash in my system.
 can you please provide your steps which causes crash on your machine?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will send
 the patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length()  wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*







Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-12 Thread Sanket Mehta
Hi John,

I have tried to reproduce the scenario but not able to reproduce the crash
in my system.
can you please provide your steps which causes crash on your machine?

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will send the
 patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length()  wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*





Re: [pgadmin-hackers] PATCH: remove redundant local variables

2015-05-21 Thread Sanket Mehta
Hi Dave,

Sure I will.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, May 21, 2015 at 3:08 PM, Dave Page dp...@pgadmin.org wrote:

 Sanket, could you review this please?

 Thanks.

 On Wed, May 20, 2015 at 8:26 PM, Dmitriy Olshevskiy olshevski...@bk.ru
 wrote:
  Hello.
  Please, take a look at this patch. There are several local variables,
 that
  obviously may be removed.
 
  --
  Dmitriy Olshevskiy
 
 
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company



Re: [pgadmin-hackers] PATCH: remove redundant local variables

2015-05-21 Thread Sanket Mehta
Hi Dave,

Patch looks good to me.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, May 21, 2015 at 3:14 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi Dave,

 Sure I will.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Thu, May 21, 2015 at 3:08 PM, Dave Page dp...@pgadmin.org wrote:

 Sanket, could you review this please?

 Thanks.

 On Wed, May 20, 2015 at 8:26 PM, Dmitriy Olshevskiy olshevski...@bk.ru
 wrote:
  Hello.
  Please, take a look at this patch. There are several local variables,
 that
  obviously may be removed.
 
  --
  Dmitriy Olshevskiy
 
 
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company





Re: [pgadmin-hackers] autocommit feature in pgadmin

2015-04-22 Thread Sanket Mehta
Hi,

I have made the following changes:

When autocommit mode is enabled and transaction is not idle, it will show a
warning message to user suggesting to close the current transaction by
executing COMMIT or ROLLBACK in order to take the effect of AUTOCOMMIT mode.

I have attached the patch with this mail.
Please review it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Apr 22, 2015 at 3:25 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi,

 Sure, I will do the required changes.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Wed, Apr 22, 2015 at 3:09 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:



 On Wed, Apr 22, 2015 at 1:23 PM, Dave Page dp...@pgadmin.org wrote:



 On Wed, Apr 22, 2015 at 8:40 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 On Tue, Apr 7, 2015 at 11:02 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 On Wed, Apr 1, 2015 at 2:31 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I have made all the changes mentioned in below mail.
 Along with that I have changed the code to read autoRollBack value in
 pgadmin/frm/frmQuery.cpp file.

 previously it was used  settings-Read(wxT(frmQuery/AutoRollBack),
 bVal, true) directly.

 Now I have changed it to settings-GetAutoRollBack() which is defined
 in sysSettings class.

 I have attached the new patch with this mail.
 Please review it and do the needful.

 Hi Sanket,

 I was just thinking a scenario:

 Let's see a user has disabled AutoCommit off.
 That means (as per your patch), BEGIN statement is appended/executed
 before running any other statement requested by the user (if required).
 Now - after executing some statement the user has changed the
 AutoCommit to on.
 But - it will be still in transaction unless user executes the
 COMMIT/ROLLBACK/END, right?

 Dave,

 Do you think, we should give notice/message to the user that he/she
 needs to execute either of the above in order to enable the AUTOCOMMIT on
 in effect?

 Dave,

 Can you please comment on this?


 Right - the user needs to be warned that the config change won't affect
 the existing transaction.

 Sanket,

 Can you please do the required changes?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi





 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com/


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Mar 31, 2015 at 9:43 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 In your patch, I see couple of issues with your patch:
 1. In pgadmin/frm/frmQuery.cpp:
 You've used settings-Read(wxT(frmQuery/AutoCommit), bVal,
 true) directly.
 You should be using the function, you've defined in sysSettings.
 i.e.
 sysSettings::GetAutoCommit()
 and, sysSettings::SetAutoCommit()

 Please follow the correct naming convention for the
 frmQuery::CommandNoBegin(...) function.
 Function must not start with a capital letter for a regular function
 (we do declare/define only the event functions with capital letters).

 2. In pgadmin/ui/frmOptions.xrc:
 A lot of changes are in this patch, which not required for this
 feature.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Mar 24, 2015 at 6:01 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Below is the description of the autocommit feature implementation
 in pgadmin:

 This feature is only applicable in query editor.

 Autocommit can be set on/off from 2 places.

 1. pgadmin main browser - File menu - Options - Query tool -
 Query editor - Enable Auto commit
 2. In Query editor - Query menu - Auto-commmit

 By default auto commit will be enabled in pgadmin.


 In any query editor session, once user uncheck this autocommit
 checkbox, depending upon postgreSQL standard for executing the query it
 will execute BEGIN; statement before executing the actual query and 
 thus
 setting the autocommit off for that session.

 User can set the autocommit on at any time by selecting the
 checkbox from above mentioned places.
 But it will be active only after user has completed the transaction
 block(started by BEGIN as mentioned above) by END or ROLLBACK or 
 COMMIT;

 Let me know in case of any queries.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb





 --
 Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org

Re: [pgadmin-hackers] autocommit feature in pgadmin

2015-04-22 Thread Sanket Mehta
Hi,

Sure, I will do the required changes.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Apr 22, 2015 at 3:09 PM, Ashesh Vashi ashesh.va...@enterprisedb.com
 wrote:



 On Wed, Apr 22, 2015 at 1:23 PM, Dave Page dp...@pgadmin.org wrote:



 On Wed, Apr 22, 2015 at 8:40 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 On Tue, Apr 7, 2015 at 11:02 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 On Wed, Apr 1, 2015 at 2:31 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I have made all the changes mentioned in below mail.
 Along with that I have changed the code to read autoRollBack value in
 pgadmin/frm/frmQuery.cpp file.

 previously it was used  settings-Read(wxT(frmQuery/AutoRollBack),
 bVal, true) directly.

 Now I have changed it to settings-GetAutoRollBack() which is defined
 in sysSettings class.

 I have attached the new patch with this mail.
 Please review it and do the needful.

 Hi Sanket,

 I was just thinking a scenario:

 Let's see a user has disabled AutoCommit off.
 That means (as per your patch), BEGIN statement is appended/executed
 before running any other statement requested by the user (if required).
 Now - after executing some statement the user has changed the
 AutoCommit to on.
 But - it will be still in transaction unless user executes the
 COMMIT/ROLLBACK/END, right?

 Dave,

 Do you think, we should give notice/message to the user that he/she
 needs to execute either of the above in order to enable the AUTOCOMMIT on
 in effect?

 Dave,

 Can you please comment on this?


 Right - the user needs to be warned that the config change won't affect
 the existing transaction.

 Sanket,

 Can you please do the required changes?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi





 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com/


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Mar 31, 2015 at 9:43 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 In your patch, I see couple of issues with your patch:
 1. In pgadmin/frm/frmQuery.cpp:
 You've used settings-Read(wxT(frmQuery/AutoCommit), bVal, true)
 directly.
 You should be using the function, you've defined in sysSettings.
 i.e.
 sysSettings::GetAutoCommit()
 and, sysSettings::SetAutoCommit()

 Please follow the correct naming convention for the
 frmQuery::CommandNoBegin(...) function.
 Function must not start with a capital letter for a regular function
 (we do declare/define only the event functions with capital letters).

 2. In pgadmin/ui/frmOptions.xrc:
 A lot of changes are in this patch, which not required for this
 feature.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Mar 24, 2015 at 6:01 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Below is the description of the autocommit feature implementation in
 pgadmin:

 This feature is only applicable in query editor.

 Autocommit can be set on/off from 2 places.

 1. pgadmin main browser - File menu - Options - Query tool -
 Query editor - Enable Auto commit
 2. In Query editor - Query menu - Auto-commmit

 By default auto commit will be enabled in pgadmin.


 In any query editor session, once user uncheck this autocommit
 checkbox, depending upon postgreSQL standard for executing the query it
 will execute BEGIN; statement before executing the actual query and 
 thus
 setting the autocommit off for that session.

 User can set the autocommit on at any time by selecting the checkbox
 from above mentioned places.
 But it will be active only after user has completed the transaction
 block(started by BEGIN as mentioned above) by END or ROLLBACK or COMMIT;

 Let me know in case of any queries.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb





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






 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company





Re: [pgadmin-hackers] PATCH: focus on browser tree on startup

2015-04-20 Thread Sanket Mehta
Hi,

Sure I will review it.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Apr 20, 2015 at 12:04 PM, Ashesh Vashi 
ashesh.va...@enterprisedb.com wrote:


 On Mon, Apr 20, 2015 at 12:25 AM, J.F. Oster jinfros...@mail.ru wrote:

 Hi!

 Explicitly set focus on the browser tree on startup. I've noticed that
 on Ubuntu that doesn't happen automatically but on Windows does!
 Make it consistent.

 Hi J.F.

 Thanks for the patch.

 Sanket,

 Can you please review it?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 --
 Best regards,
  J.F.

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





Re: [pgadmin-hackers] PATCH: focus on browser tree on startup

2015-04-20 Thread Sanket Mehta
Hi Ashesh,

I have reviewed the patch on Ubuntu.
It is getting focus on start up after applying the patch.
So patch is working fine.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Apr 20, 2015 at 12:45 PM, Sanket Mehta 
sanket.me...@enterprisedb.com wrote:

 Hi,

 Sure I will review it.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Apr 20, 2015 at 12:04 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:


 On Mon, Apr 20, 2015 at 12:25 AM, J.F. Oster jinfros...@mail.ru wrote:

 Hi!

 Explicitly set focus on the browser tree on startup. I've noticed that
 on Ubuntu that doesn't happen automatically but on Windows does!
 Make it consistent.

 Hi J.F.

 Thanks for the patch.

 Sanket,

 Can you please review it?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 --
 Best regards,
  J.F.

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






Re: [pgadmin-hackers] PgAgent Patch

2015-04-17 Thread Sanket Mehta
Hi Mehmet,

I have modified the patch as explained below:

After carefully reviewing the patch, we found that there is a memory leak
while error file handling.

after opening the file in write mode using freopen(), we again open the
same file in read mode using fopen().
at this time we are just opening a file without any stderr stream getting
redirected. So it should be closed after read operation.
Which was not happening before and its a memory leak.

previously we were using the same FILE* which is used in freopen() for
opening the file using fopen(), so when we close the handler internally it
may have close the stream and thus we were not getting the std error for
the 2nd time.

But now I have used another FILE* handler to open that file in read mode
using fopen() and closed it after read operation and it works fine.
Errors are getting logged in table every time properly.

Another change is that we std errors should get logged in file every time
irrespective of output string is empty or not. so I have removed the
condition if(output == wxEmptyString) .

I have attached the new patch here.
Please test and let me know if you think any changes requires.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Apr 15, 2015 at 6:23 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi,

 I have reviewed the patch.
 You are right Mehmet, previously 2nd time stderr was not coming to file.
 With this patch that issue is resolved.



 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Wed, Apr 15, 2015 at 3:27 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
 wrote:

 Hi,


 We are using the patch. But  We make a mistake. Pgagent run the agent
 first time, everything is perfect. But second batch run , pgagent is not
 get  stderr message. Then I have reviewed the patch. we are using freopen
 for redirect stderr massage to file. Then we  close the error file. But If
 close the file, close the stderr message at the same time and I don't any
 error message form stderror. So, I remove the fclose code for errorfile.
 Now Every things is ok.
 I make to test it on windows 7 and ubuntu 14.10. It is working fine. I
 attached the patch in this mail.

 2015-04-09 10:00 GMT+03:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 I have reviewed the patch.
 It is working fine.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Apr 6, 2015 at 7:30 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
 wrote:

 Hi,

 What is the last situation? I want to remove my repo and continue
 original repo.

 Thanks for everything.


 2015-03-23 10:58 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com
 :

 On Mon, Mar 23, 2015 at 2:26 PM, Mehmet Emin KARAKAŞ 
 emin...@gmail.com wrote:

 I send the diff in previous mail. The name
 batch_cron_error_20150323.patch. You need to something diffrent. I don't
 understand.

 Oops.
 I missed that.

 When I saw the job.cpp, I thought - you sent the whole files only.
 Thanks for the patch.

 Sanket,

 Can you please review the patch?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 2015-03-23 10:36 GMT+02:00 Ashesh Vashi 
 ashesh.va...@enterprisedb.com:

 Thanks Mehmet.
 Can you please send the diff (as a patch file) instead of the whole
 file?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Mon, Mar 23, 2015 at 1:54 PM, Mehmet Emin KARAKAŞ 
 emin...@gmail.com wrote:

 Hi Ashesh,

 My test scenario is;

 java -jar  command.

 xxx is not a file. I want to see a error message in pgadmin and
 pga_jobsteplog table. I am waiting to Error: Unable to access jarfile
  message in job log output.

 I make test the patch in windows 7 and ubuntu 14.10. In windows 7
 not problem, perfect working. But nix system (Ubuntu 14.10) debug 
 mode, I
 just saw the massage in terminal. Then I added to message error file to
 output variable.

 Now It's working perfect windows and nix systems. I attach the new
 patch in this message.


 2015-03-23 1:15 GMT+02:00 Mehmet Emin KARAKAŞ emin...@gmail.com:

 Hi Ashesh ,
 Sorry for late. I have test in today and share the results

 2015-03-16 10:32 GMT+02:00 Ashesh Vashi 
 ashesh.va...@enterprisedb.com:

 On Mon, Mar 16, 2015 at 1:31 PM, Mehmet Emin KARAKAŞ 
 emin...@gmail.com wrote:

 Hi,

 I have not tried the patch because last week was very run down.
 But I will try the patch in this week and I will share the result.

 Thanks.
 I really appreciate.

 [NOTE: Please keep the list in loop...]


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi


 2015-03-16 6:16 GMT+02:00

Re: [pgadmin-hackers] Patch : PGPASSFILE fix

2015-04-16 Thread Sanket Mehta
Hi,

Below is my understanding of this patch:

When checking for password file in getconfigfile() function, it should
first check for parent directory and if that does not exists then it should
create it.
Same operation should happen for password file also.

If my understanding is correct, the patch is working fine on windows and
Ubuntu 14.04 platform.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Apr 14, 2015 at 4:28 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi Ashesh,


 On Tue, Apr 14, 2015 at 2:37 PM, Prasad prasa...@mail.com wrote:

 Ashesh,

 You able to review this patch ?


 I am currently reviewing the patch.

 regards,
 Prasad



 Sent: Friday, April 03, 2015 at 11:46 PM
 From: Prasad prasa...@mail.com
 To: pgadmin-hackers pgadmin-hackers@postgresql.org
 Subject: Re: [pgadmin-hackers] Patch : PGPASSFILE fix
 HI,

 Finally, able to finish it. wX has option to create recursive
 directories. Just needed to remember first folder we are creating, so that
 can be deleted in case of error. Find attached patch.

 regards,
 Prasad



 Sent: Wednesday, March 25, 2015 at 11:35 AM
 From: Prasad prasa...@mail.com.


 To: pgadmin-hackers pgadmin-hackers@postgresql.org
 Subject: Re: [pgadmin-hackers] Patch : PGPASSFILE fix
 I'm still looking in to this. Was busy with day work. Should have
 something by weekend.

 regards,
 Prasad



 Sent: Wednesday, March 11, 2015 at 2:32 PM
 From: Dave Page dp...@pgadmin.org
 To: Ashesh Vashi ashesh.va...@enterprisedb.com
 Cc: Prasad prasa...@mail.com, pgadmin-hackers 
 pgadmin-hackers@postgresql.org
 Subject: Re: [pgadmin-hackers] Patch : PGPASSFILE fixnd
 ashesh.va...@enterprisedb.com wrote:
  On Wed, Mar 11, 2015 at 1:06 PM, Prasad prasa...@mail.com wrote:
 
  I think, we need to agree what exactly solution should be. About
 creating
  parent directories.It's going to complicate solution, path can be of
 any
  depth. i.e. /a/b/c/d/e/.pgpass, and none of these folders could
 present. Are
  we going to keep on creating all folders ?
 
  Agree - it's going to be complicated.

 It's not that hard - see

 http://nion.modprobe.de/blog/archives/357-Recursive-directory-creation.html
 for example. wx should make that even easier I expect.

 The only unhandled issue is what to do if we get an error on any of
 the directories. I would suggest just keeping an array of what we
 actually create, and removing any created prior to the error so we
 return the users filesystem to its original state.

 
  regards,
  Prasad
 
 
 
  Sent: Tuesday, March 10, 2015 at 7:09 AM
  From: Ashesh Vashi ashesh.va...@enterprisedb.comut
  To: Prasad prasa...@mail.com
  Cc: Dave Page dp...@pgadmin.org, pgadmin-hackers
  pgadmin-hackers@postgresql.org
  Subject: Re: [pgadmin-hackers] Patch : PGPASSFILE fix
 
  Hi Prasad,
 
  On Thu, Mar 5, 2015 at 4:20 AM, Prasad prasa...@mail.com wrote:
 
  Hi,
 
  As mentioned in my earlier communication code calling this function is
  checking for file existence. So if we decide to add code for creation
 of
  full path, then similar code has to be removed from location of call
 to this
  function. Otherwise, it will end up with multiple error messages. It's
  wxWidget's wxFile that throws error.
 
  So, I've created two patches, and we can go with one of them.
  1. Let GetConfigFile function just read value from PGPASSFILE and
 return
  as it is as like, similar to way it creates default path(It doesn't
 create
  file in case of default path as well). And calling functions are
 taking care
  of path validation and error messages.
  This won't work.
  We should create the file, if it does not exists (and, the path).2. Let
  GetConfigFile function read value from PGPASSFILE and create file path
 ,it
  will show error message in case it can't. In this case calling code
 only
  should check existence of file before going ahead, and not try to
 create or
  read file, otherwise , user will end up with multiple message boxes
 with
  same error.
  The patch, you shared, do not create the path (parent directories) for
 the
  PGPASSFILE (if it does not exists).
  You're only creating the file, which is not right.
 
  NOTE:
  Please do not mix tabs and spaces in your patch.
  I am still not able to apply the patch using 'git apply' utility.
 
 
  --
  Thanks  Regards,
 
  Ashesh Vashi
  EnterpriseDB INDIA: Enterprise PostgreSQL
  Company[http://www.enterprisedb.com[http://www.enterprisedb.com][
 http://www.enterprisedb.com[http://www.enterprisedb.com]][
 http://www.enterprisedb.com[http://www.enterprisedb.com][
 http://www.enterprisedb.com[http://www.enterprisedb.com
 
 
 
 http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi][http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi]][http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi][http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi]]][http://www.linkedin.com/in/asheshvashi[http

Re: [pgadmin-hackers] PgAgent Patch

2015-04-15 Thread Sanket Mehta
Hi,

I have reviewed the patch.
You are right Mehmet, previously 2nd time stderr was not coming to file.
With this patch that issue is resolved.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Wed, Apr 15, 2015 at 3:27 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
wrote:

 Hi,


 We are using the patch. But  We make a mistake. Pgagent run the agent
 first time, everything is perfect. But second batch run , pgagent is not
 get  stderr message. Then I have reviewed the patch. we are using freopen
 for redirect stderr massage to file. Then we  close the error file. But If
 close the file, close the stderr message at the same time and I don't any
 error message form stderror. So, I remove the fclose code for errorfile.
 Now Every things is ok.
 I make to test it on windows 7 and ubuntu 14.10. It is working fine. I
 attached the patch in this mail.

 2015-04-09 10:00 GMT+03:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 I have reviewed the patch.
 It is working fine.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Apr 6, 2015 at 7:30 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
 wrote:

 Hi,

 What is the last situation? I want to remove my repo and continue
 original repo.

 Thanks for everything.


 2015-03-23 10:58 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com:

 On Mon, Mar 23, 2015 at 2:26 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
  wrote:

 I send the diff in previous mail. The name
 batch_cron_error_20150323.patch. You need to something diffrent. I don't
 understand.

 Oops.
 I missed that.

 When I saw the job.cpp, I thought - you sent the whole files only.
 Thanks for the patch.

 Sanket,

 Can you please review the patch?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 2015-03-23 10:36 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com
 :

 Thanks Mehmet.
 Can you please send the diff (as a patch file) instead of the whole
 file?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Mon, Mar 23, 2015 at 1:54 PM, Mehmet Emin KARAKAŞ 
 emin...@gmail.com wrote:

 Hi Ashesh,

 My test scenario is;

 java -jar  command.

 xxx is not a file. I want to see a error message in pgadmin and
 pga_jobsteplog table. I am waiting to Error: Unable to access jarfile
  message in job log output.

 I make test the patch in windows 7 and ubuntu 14.10. In windows 7
 not problem, perfect working. But nix system (Ubuntu 14.10) debug mode, 
 I
 just saw the massage in terminal. Then I added to message error file to
 output variable.

 Now It's working perfect windows and nix systems. I attach the new
 patch in this message.


 2015-03-23 1:15 GMT+02:00 Mehmet Emin KARAKAŞ emin...@gmail.com:

 Hi Ashesh ,
 Sorry for late. I have test in today and share the results

 2015-03-16 10:32 GMT+02:00 Ashesh Vashi 
 ashesh.va...@enterprisedb.com:

 On Mon, Mar 16, 2015 at 1:31 PM, Mehmet Emin KARAKAŞ 
 emin...@gmail.com wrote:

 Hi,

 I have not tried the patch because last week was very run down.
 But I will try the patch in this week and I will share the result.

 Thanks.
 I really appreciate.

 [NOTE: Please keep the list in loop...]


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi


 2015-03-16 6:16 GMT+02:00 Ashesh Vashi 
 ashesh.va...@enterprisedb.com:

 HI Mehmet,

 Do you have time to spend time for this?
 Can you please review, and test the patch sent by Akshay?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Thu, Mar 5, 2015 at 3:07 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Hi Mehmet

 I have added the logic in job.cpp file to read the error
 message, If batch job is failed. Attached is the patch file
 and job.cpp with the email.
 I haven't tested it because facing some difficulty in linking
 the project on Windows. Can you please apply the patch and test it 
 at your
 end, also if you seen some modification please feel free to do it.

 On Wed, Mar 4, 2015 at 4:22 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Sure.

 On Wed, Mar 4, 2015 at 4:20 PM, Dave Page dp...@pgadmin.org
 wrote:



 On Wed, Mar 4, 2015 at 10:48 AM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Dave,

 On Wed, Mar 4, 2015 at 4:11 PM, Dave Page dp...@pgadmin.org
  wrote:

 Hi,

 Mehmet may not be able to work on Windows, so one of us may
 have to deal with that. Did we not solve this already in PEM 
 btw?


 Yes we have solved it in PEM, I

Re: [pgadmin-hackers] PgAgent Patch

2015-04-09 Thread Sanket Mehta
Hi,

I have reviewed the patch.
It is working fine.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Apr 6, 2015 at 7:30 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
wrote:

 Hi,

 What is the last situation? I want to remove my repo and continue original
 repo.

 Thanks for everything.


 2015-03-23 10:58 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com:

 On Mon, Mar 23, 2015 at 2:26 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
 wrote:

 I send the diff in previous mail. The name
 batch_cron_error_20150323.patch. You need to something diffrent. I don't
 understand.

 Oops.
 I missed that.

 When I saw the job.cpp, I thought - you sent the whole files only.
 Thanks for the patch.

 Sanket,

 Can you please review the patch?


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi



 2015-03-23 10:36 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com:

 Thanks Mehmet.
 Can you please send the diff (as a patch file) instead of the whole
 file?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Mon, Mar 23, 2015 at 1:54 PM, Mehmet Emin KARAKAŞ emin...@gmail.com
  wrote:

 Hi Ashesh,

 My test scenario is;

 java -jar  command.

 xxx is not a file. I want to see a error message in pgadmin and
 pga_jobsteplog table. I am waiting to Error: Unable to access jarfile
  message in job log output.

 I make test the patch in windows 7 and ubuntu 14.10. In windows 7 not
 problem, perfect working. But nix system (Ubuntu 14.10) debug mode, I just
 saw the massage in terminal. Then I added to message error file to output
 variable.

 Now It's working perfect windows and nix systems. I attach the new
 patch in this message.


 2015-03-23 1:15 GMT+02:00 Mehmet Emin KARAKAŞ emin...@gmail.com:

 Hi Ashesh ,
 Sorry for late. I have test in today and share the results

 2015-03-16 10:32 GMT+02:00 Ashesh Vashi 
 ashesh.va...@enterprisedb.com:

 On Mon, Mar 16, 2015 at 1:31 PM, Mehmet Emin KARAKAŞ 
 emin...@gmail.com wrote:

 Hi,

 I have not tried the patch because last week was very run down.
 But I will try the patch in this week and I will share the result.

 Thanks.
 I really appreciate.

 [NOTE: Please keep the list in loop...]


 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi


 2015-03-16 6:16 GMT+02:00 Ashesh Vashi 
 ashesh.va...@enterprisedb.com:

 HI Mehmet,

 Do you have time to spend time for this?
 Can you please review, and test the patch sent by Akshay?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Thu, Mar 5, 2015 at 3:07 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Hi Mehmet

 I have added the logic in job.cpp file to read the error message, If
 batch job is failed. Attached is the patch file and job.cpp with the 
 email.
 I haven't tested it because facing some difficulty in linking the
 project on Windows. Can you please apply the patch and test it at 
 your end,
 also if you seen some modification please feel free to do it.

 On Wed, Mar 4, 2015 at 4:22 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Sure.

 On Wed, Mar 4, 2015 at 4:20 PM, Dave Page dp...@pgadmin.org
 wrote:



 On Wed, Mar 4, 2015 at 10:48 AM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Dave,

 On Wed, Mar 4, 2015 at 4:11 PM, Dave Page dp...@pgadmin.org
 wrote:

 Hi,

 Mehmet may not be able to work on Windows, so one of us may
 have to deal with that. Did we not solve this already in PEM btw?


 Yes we have solved it in PEM, I have send the source code
 in my previous email.


 Oh, that was it? Well that code is pretty well tried and
 tested, so maybe we should just use that. Perhaps you can send 
 Mehmet a
 patch to test on his build?



 On Wed, Mar 4, 2015 at 10:16 AM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Hi Mehmet

 I have reviewed the patch, but it is only for nix machine.
 Can you please provide a patch where it should be fixed for 
 Windows as
 well. I have implemented the same in one of my project using 
 below logic
 which works for both windows and nix. You can tried out the 
 below logic

 errFile = 'xyz.txt';
 FILE *fpError = freopen(errFile.mb_str(), w, stderr);
   // If output is empty then either job did not return 
 any output
 // or job threw some error into stderr. if (output ==
 wxEmptyString) { // Check script threw some error into
 stderr if (fpError) { fclose(fpError); fpError = fopen(
 errFile.mb_str(), r); if (fpError

Re: [pgadmin-hackers] autocommit feature in pgadmin

2015-04-07 Thread Sanket Mehta
Hi Ashesh,

Yes you are right.
It will be still in transaction till user executes COMMIT/ROLLBACK/END.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Apr 7, 2015 at 11:02 AM, Ashesh Vashi ashesh.va...@enterprisedb.com
 wrote:

 On Wed, Apr 1, 2015 at 2:31 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I have made all the changes mentioned in below mail.
 Along with that I have changed the code to read autoRollBack value in
 pgadmin/frm/frmQuery.cpp file.

 previously it was used  settings-Read(wxT(frmQuery/AutoRollBack),
 bVal, true) directly.

 Now I have changed it to settings-GetAutoRollBack() which is defined in
 sysSettings class.

 I have attached the new patch with this mail.
 Please review it and do the needful.

 Hi Sanket,

 I was just thinking a scenario:

 Let's see a user has disabled AutoCommit off.
 That means (as per your patch), BEGIN statement is appended/executed
 before running any other statement requested by the user (if required).
 Now - after executing some statement the user has changed the AutoCommit
 to on.
 But - it will be still in transaction unless user executes the
 COMMIT/ROLLBACK/END, right?

 Dave,

 Do you think, we should give notice/message to the user that he/she needs
 to execute either of the above in order to enable the AUTOCOMMIT on in
 effect?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com/


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Mar 31, 2015 at 9:43 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 In your patch, I see couple of issues with your patch:
 1. In pgadmin/frm/frmQuery.cpp:
 You've used settings-Read(wxT(frmQuery/AutoCommit), bVal, true)
 directly.
 You should be using the function, you've defined in sysSettings.
 i.e.
 sysSettings::GetAutoCommit()
 and, sysSettings::SetAutoCommit()

 Please follow the correct naming convention for the
 frmQuery::CommandNoBegin(...) function.
 Function must not start with a capital letter for a regular function (we
 do declare/define only the event functions with capital letters).

 2. In pgadmin/ui/frmOptions.xrc:
 A lot of changes are in this patch, which not required for this feature.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Mar 24, 2015 at 6:01 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Below is the description of the autocommit feature implementation in
 pgadmin:

 This feature is only applicable in query editor.

 Autocommit can be set on/off from 2 places.

 1. pgadmin main browser - File menu - Options - Query tool - Query
 editor - Enable Auto commit
 2. In Query editor - Query menu - Auto-commmit

 By default auto commit will be enabled in pgadmin.


 In any query editor session, once user uncheck this autocommit
 checkbox, depending upon postgreSQL standard for executing the query it
 will execute BEGIN; statement before executing the actual query and thus
 setting the autocommit off for that session.

 User can set the autocommit on at any time by selecting the checkbox
 from above mentioned places.
 But it will be active only after user has completed the transaction
 block(started by BEGIN as mentioned above) by END or ROLLBACK or COMMIT;

 Let me know in case of any queries.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb





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





Re: [pgadmin-hackers] autocommit feature in pgadmin

2015-04-01 Thread Sanket Mehta
Hi,

I have made all the changes mentioned in below mail.
Along with that I have changed the code to read autoRollBack value in
pgadmin/frm/frmQuery.cpp file.

previously it was used  settings-Read(wxT(frmQuery/AutoRollBack),
bVal, true) directly.

Now I have changed it to settings-GetAutoRollBack() which is defined in
sysSettings class.

I have attached the new patch with this mail.
Please review it and do the needful.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Mar 31, 2015 at 9:43 PM, Ashesh Vashi ashesh.va...@enterprisedb.com
 wrote:

 Hi Sanket,

 In your patch, I see couple of issues with your patch:
 1. In pgadmin/frm/frmQuery.cpp:
 You've used settings-Read(wxT(frmQuery/AutoCommit), bVal, true)
 directly.
 You should be using the function, you've defined in sysSettings.
 i.e.
 sysSettings::GetAutoCommit()
 and, sysSettings::SetAutoCommit()

 Please follow the correct naming convention for the
 frmQuery::CommandNoBegin(...) function.
 Function must not start with a capital letter for a regular function (we
 do declare/define only the event functions with capital letters).

 2. In pgadmin/ui/frmOptions.xrc:
 A lot of changes are in this patch, which not required for this feature.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Mar 24, 2015 at 6:01 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Below is the description of the autocommit feature implementation in
 pgadmin:

 This feature is only applicable in query editor.

 Autocommit can be set on/off from 2 places.

 1. pgadmin main browser - File menu - Options - Query tool - Query
 editor - Enable Auto commit
 2. In Query editor - Query menu - Auto-commmit

 By default auto commit will be enabled in pgadmin.


 In any query editor session, once user uncheck this autocommit checkbox,
 depending upon postgreSQL standard for executing the query it will execute
 BEGIN; statement before executing the actual query and thus setting the
 autocommit off for that session.

 User can set the autocommit on at any time by selecting the checkbox from
 above mentioned places.
 But it will be active only after user has completed the transaction
 block(started by BEGIN as mentioned above) by END or ROLLBACK or COMMIT;

 Let me know in case of any queries.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb





autocommit.patch
Description: Binary data

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


[pgadmin-hackers] autocommit feature in pgadmin

2015-03-24 Thread Sanket Mehta
Hi,

Below is the description of the autocommit feature implementation in
pgadmin:

This feature is only applicable in query editor.

Autocommit can be set on/off from 2 places.

1. pgadmin main browser - File menu - Options - Query tool - Query
editor - Enable Auto commit
2. In Query editor - Query menu - Auto-commmit

By default auto commit will be enabled in pgadmin.


In any query editor session, once user uncheck this autocommit checkbox,
depending upon postgreSQL standard for executing the query it will execute
BEGIN; statement before executing the actual query and thus setting the
autocommit off for that session.

User can set the autocommit on at any time by selecting the checkbox from
above mentioned places.
But it will be active only after user has completed the transaction
block(started by BEGIN as mentioned above) by END or ROLLBACK or COMMIT;

Let me know in case of any queries.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb


Re: [pgadmin-hackers] Review Request 306: RM 33614 - Autocommit on/off option in PEM client

2015-03-24 Thread Sanket Mehta
Hi,

I have developed the *Autocommit* feature in pgadmin and its patch is
attached with this mail.
Please do review and commit it.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Mar 17, 2015 at 2:01 AM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

This is an automatically generated e-mail. To reply, visit:
 https://scm.enterprisedb.com/reviews/r/306/
   Review request for Postgres Enterprise Manager, Akshay Joshi and Ashesh
 Vashi.
 By Sanket Mehta.
  *Repository: * PEM
 Description

 In Autocommit on/off option in pem client:

 Enable autocommit option is provided in pem client at 2 places:

 1. pem client - File menu - Options - Query Editor - Enable AUTO COMMIT
 2. sql query tool - Query menu - Auto-commit

 User can select/deselect its value from any of the above 2 places and it will 
 be reflected to other one.

 In any query tool session, once user uncheck this checkbox, depending upon 
 postgreSQL standard for executing the query it will execute BEGIN; 
 statement first at the time of executing the query and thus setting the 
 autocommit off for that session.

 User can set the autocommit on at any time by selecting the checkbox from 
 above mentioned places.
 But it will be active only after user has completed the transaction 
 block(started by BEGIN as mentioned above) by END or ROLLBACk or COMMIT;


   Testing

 - setting autocommit on/off from client window.
 - setting autocommit on/off from query tool.
 - Setting the autocommit mode on/off in database

   Diffs

- pgadmin/ui/frmOptions.xrc (a57b0ce)
- pgadmin/include/frm/menu.h (fb20b60)
- pgadmin/include/frm/frmQuery.h (c698370)
- pgadmin/frm/frmQuery.cpp (23ec45b)
- pgadmin/frm/frmOptions.cpp (4b3b1f1)
- docs/en_US/options-query_tool.rst (0b557e7)

 View Diff https://scm.enterprisedb.com/reviews/r/306/diff/



RM_33614v3.patch
Description: Binary data

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


Re: [pgadmin-hackers] Review patches regarding memory leaks in pgadmin fat client

2014-12-24 Thread Sanket Mehta
Hi Akshay,

PFA the patch for memory leaks found in pgadmin desktop client.

Below are the files modified and scenario in which this memory leak will
occur.

*1.pgadmin/frm/frmQuery.cpp:*

*2.pgadmin/gqb/gqbModel.cpp:*
*3.pgadmin/gqb/gqbView.cpp*
*Scenario:*
After closing the graphic query builder dialog, memory leak occurred.

*4.pgadmin/ogl/canvas.cpp:*
*Scenario:*

This memory leak was found in OGL module as m_shapeDiagram was not being
deleted in destructor  of canvas class.

Please review this patch and let me know in case anything is missing.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Thu, Dec 18, 2014 at 7:02 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi Akshay,

 PFA the patch to resolve memory leaks in pgadmin desktop client.

 Below are the files modified and scenario in which this memory leak will
 occur.

 *1. pgadmin/dlg/dlgProperty.cpp:*
 *scenario 1:*
  In table property dialog, memory leak occurs while filling the owner's
 combo box in properties tab as in * dlgProperty::FillComboBox() *function
 set was not being deleted.


 *scenario 2:*
 in Database property window, memory leak occurred while filling owner's
 combo box in properties tab as in *dlgDefaultSecurityProperty::AddUsers()
 *function set was not being deleted.

 *2. pgadmin/dlg/dlgSelectDatabase.cpp:*
 *scenario 1: *
 in step dialog, while selecting database output string using selection
 button, memory leak occurred as in *dlgSelectDatabase::Initialize() *function
 pgSet* res was not being deleted.

 *scenario 2: *
 in step dialog, while selecting the database output string using selection
 button, when trying to connect to any database, memory leak occurred as in 
 *dlgSelectDatabase::OnSelActivate()
 function *pgSet** *res was not being deleted.

 *3. pgadmin/frm/frmEditGrid.cpp:*
 *scenario:*
 While opening table data in grid view, memory leak occurred in sqlTable
 constructor as allColsSet was not being deleted

 *4.pgadmin/utils/registry.cpp:*
 *scenario: *
 while reading the registery at the start of the client, pBuf buffer was
 not being deleted after reading the registry value inside
 *pgRegKey::QueryValue()* function.

 *5.pgadmin/utils/sysSettings.cpp:*
 *scenario:*
 wxFileConfig* defaultSetting was not being deleted at the time of closing
 pgadmin.

 *6.pgadmin/schema/pgTypes.cpp:*
 *Scenario:*
 while expanding type node of composite type in object browser, memory leak
 occurred because pgSet* set was not deleted in *pgType::ShowTreeDetails()*
 function.

 *7.pgadmin/schema/pgTrigger.cpp:*
 *scenario:*
 while expanding trigger node in object browser, memory leak occurred
 because pgSet* res was not deleted in *pgTrigger::ReadColumnDetails()*
 function.

 *8. pgadmin/schema/pgIndex.cpp:*
 *scenario:*
 while expanding Index node in object browser, memory leak occurred because
 pgSet* res was not deleted in *pgIndexBase::ReadColumnDetails()* function.

 *9.pgadmin/schema/pgAggregate.cpp:*
 *Scenario:*
 While creating new aggregate function memory leak occurred because pgSet*
 types was not deleted in *pgAggregateFactory::CreateObjects()* function.

 *10.pgadmin/debugger/debugger.cpp:*
 *scenario 1:*
 while starting to debug a sql function in pgadmin, memory leak occurred
 because in *debuggerFactory::startDialog()* function pgSet* res was not
 deleted before any return statement

 *scenario 2:*
 While setting a break point in a sql function in pgadmin, memory leak
 occurred because in *breakpointFactory::startDialog()* function pgSet*
 res was not deleted before any return statement

 *11.pgadmin/schema/gpExtTable.cpp:*
 *Scenario:*
 At the time of getting the sql while creating/modifying/deleting the
 greenplum external Table memory leak occurred in function
 gpExtTable::GetSql() as pgSet* extTable was not being deleted before return
 statement.

 *12.pgadmin/dd/ddmodel/ddDbReverseEngineering.cpp*
 *Scenario 1:*
 While reverse engineering wizard is open, memory was occurred when moving
 from select table page as in function *ddImportDBUtils::getTable()*
 pgSet* inhtables was not deleted.and another memory leak was there as in
 functions *ddImportDBUtils::getAllRelationships() and *
 *ddImportDBUtils::isModelSameDbFk()*  pgSet* foreignKeys was not deleted
 before return statement.

 Please review it and let me know if anything is missing.
 I will also send further patches in case i find more memory leaks.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb



memory_leak_pgadmin2.patch
Description: Binary data

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


[pgadmin-hackers] Review patches regarding memory leaks in pgadmin fat client

2014-12-18 Thread Sanket Mehta
Hi Akshay,

PFA the patch to resolve memory leaks in pgadmin desktop client.

Below are the files modified and scenario in which this memory leak will
occur.

*1. pgadmin/dlg/dlgProperty.cpp:*
*scenario 1:*
 In table property dialog, memory leak occurs while filling the owner's
combo box in properties tab as in * dlgProperty::FillComboBox() *function
set was not being deleted.


*scenario 2:*
in Database property window, memory leak occurred while filling owner's
combo box in properties tab as in
*dlgDefaultSecurityProperty::AddUsers() *function
set was not being deleted.

*2. pgadmin/dlg/dlgSelectDatabase.cpp:*
*scenario 1: *
in step dialog, while selecting database output string using selection
button, memory leak occurred as in *dlgSelectDatabase::Initialize() *function
pgSet* res was not being deleted.

*scenario 2: *
in step dialog, while selecting the database output string using selection
button, when trying to connect to any database, memory leak occurred
as in *dlgSelectDatabase::OnSelActivate()
function *pgSet** *res was not being deleted.

*3. pgadmin/frm/frmEditGrid.cpp:*
*scenario:*
While opening table data in grid view, memory leak occurred in sqlTable
constructor as allColsSet was not being deleted

*4.pgadmin/utils/registry.cpp:*
*scenario: *
while reading the registery at the start of the client, pBuf buffer was not
being deleted after reading the registry value inside
*pgRegKey::QueryValue()* function.

*5.pgadmin/utils/sysSettings.cpp:*
*scenario:*
wxFileConfig* defaultSetting was not being deleted at the time of closing
pgadmin.

*6.pgadmin/schema/pgTypes.cpp:*
*Scenario:*
while expanding type node of composite type in object browser, memory leak
occurred because pgSet* set was not deleted in *pgType::ShowTreeDetails()*
function.

*7.pgadmin/schema/pgTrigger.cpp:*
*scenario:*
while expanding trigger node in object browser, memory leak occurred
because pgSet* res was not deleted in *pgTrigger::ReadColumnDetails()*
function.

*8. pgadmin/schema/pgIndex.cpp:*
*scenario:*
while expanding Index node in object browser, memory leak occurred because
pgSet* res was not deleted in *pgIndexBase::ReadColumnDetails()* function.

*9.pgadmin/schema/pgAggregate.cpp:*
*Scenario:*
While creating new aggregate function memory leak occurred because pgSet*
types was not deleted in *pgAggregateFactory::CreateObjects()* function.

*10.pgadmin/debugger/debugger.cpp:*
*scenario 1:*
while starting to debug a sql function in pgadmin, memory leak occurred
because in *debuggerFactory::startDialog()* function pgSet* res was not
deleted before any return statement

*scenario 2:*
While setting a break point in a sql function in pgadmin, memory leak
occurred because in *breakpointFactory::startDialog()* function pgSet* res
was not deleted before any return statement

*11.pgadmin/schema/gpExtTable.cpp:*
*Scenario:*
At the time of getting the sql while creating/modifying/deleting the
greenplum external Table memory leak occurred in function
gpExtTable::GetSql() as pgSet* extTable was not being deleted before return
statement.

*12.pgadmin/dd/ddmodel/ddDbReverseEngineering.cpp*
*Scenario 1:*
While reverse engineering wizard is open, memory was occurred when moving
from select table page as in function *ddImportDBUtils::getTable()* pgSet*
inhtables was not deleted.and another memory leak was there as in
functions *ddImportDBUtils::getAllRelationships()
and **ddImportDBUtils::isModelSameDbFk()*  pgSet* foreignKeys was not
deleted before return statement.

Please review it and let me know if anything is missing.
I will also send further patches in case i find more memory leaks.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb


memory_leak_pgadmin.patch
Description: Binary data

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


Re: [pgadmin-hackers] potential invalid input field of pgAdmin New Column GUI

2014-11-28 Thread Sanket Mehta
Hi Ashesh,

On Wed, Nov 26, 2014 at 7:35 PM, Ashesh Vashi ashesh.va...@enterprisedb.com
 wrote:

 Hi Sanket,

 On Wed, Nov 26, 2014 at 5:41 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Hi Sanket

 Patch looks good to me. I have tested couple of scenarios and it works
 fine.

 On Wed, Nov 26, 2014 at 3:27 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Akshay,


 On Tue, Nov 25, 2014 at 2:57 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Hi Sanket

 On Mon, Nov 24, 2014 at 5:18 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Akshay,


 On Wed, Nov 19, 2014 at 4:39 PM, Akshay Joshi 
 akshay.jo...@enterprisedb.com wrote:

 Hi Sanket

 Below are the file wise review comments


1. ctlSeclabelPanel.cpp and ctlSeclabelPanel.h
- Correct the function name GetCUrrentProviderLabelArray
   according to camel case.
   - Use trim before check the empty condition of txtProvider and
   txtSeclabel used in ctlSeclabelPanel::OnChange().
2. dlgTable.cpp
   - Security label sql not removed from SQL pane of dlgTable
   even though I have removed the column.
   - Security label sql gets overwritten when I add more then one
   column.
   - Changes are overwritten in the SQL pane of dlgTable when I
   have changed the attributes of the column more then once by 
 clicking on
   Change button.

   Above Issue is still reproducible.

  All the reproducible issues are resolved.


1. dlgColumn.cpp
   -  Remove comment //code removed for testing from constructor
   if testing is done.

 Above issues are resolved.
 PFA the revised patch.


 I have found one more issue when we add security label while
 creating a new table it throws syntax error.

 This issue is also resolved.

 PFA the revised patch.

 I can see the memory leak, while closing the table dialog.
 While changing the column, we do create column2 for preserving the data,
 but it is never been released.

 Can you please cross check?

 *Resolved.*

*PFA the revised patch.*



--

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi





 On Tue, Nov 18, 2014 at 6:10 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Below are the thing I have taken care in this patch:

 1. While creating the new table using table wizard, when any
 variables or security labels are specified for certain column, those
 were not visible on *sql tab* of table wizard.
 2. when new/existing column dialog is open from table dialog then
 privileges and security labels in column dialog are not being persistent
 for new changes.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 18, 2014 at 5:54 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Akshay,

 PFA the patch.
 Please review it and let me know if anything is missing.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 11, 2014 at 7:21 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Apart from variable persistence issue taken care in your patch,
 I've also observed the data persistence issue with:
 (When reloading the existing/new column in column dialog from
 table dialog)
 1. Priviledges
 2. Security Lables

 I also observed, when I remove some privileges from an existing
 column, it generates SQL like, it needs to remove that column first, 
 and
 then add that column, and the modify the new privileges.
 Can you also look into it?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 7:06 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Quick review suggests that, you're not following the consistent
 name convention in new functions as per pgAdmin3 coding standard.
 I also observed a white-space warning, while apply the patch.

 Please resend the patch after resolving these issues.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 5:25 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Issue was occurring as mentioned below:

 While creating the new table using table wizard, when any
 variables or security labels are specified for certain column then 
 in
 *dlgTable* class, it was not fetching those variable or
 security labels from *dlgColumn *class. So those were not
 visible on *sql tab* of new table wizard.

 I have resolved that issue and created the patch for the same.
 Patch is attached with this mail. Please review it and if it
 looks good, please

Re: [pgadmin-hackers] potential invalid input field of pgAdmin New Column GUI

2014-11-24 Thread Sanket Mehta
Hi Akshay,


On Wed, Nov 19, 2014 at 4:39 PM, Akshay Joshi akshay.jo...@enterprisedb.com
 wrote:

 Hi Sanket

 Below are the file wise review comments


1. ctlSeclabelPanel.cpp and ctlSeclabelPanel.h
- Correct the function name GetCUrrentProviderLabelArray according
   to camel case.
   - Use trim before check the empty condition of txtProvider and
   txtSeclabel used in ctlSeclabelPanel::OnChange().
2. dlgTable.cpp
   - Security label sql not removed from SQL pane of dlgTable even
   though I have removed the column.
   - Security label sql gets overwritten when I add more then one
   column.
   - Changes are overwritten in the SQL pane of dlgTable when I have
   changed the attributes of the column more then once by clicking on 
 Change
   button.
3. dlgColumn.cpp
   -  Remove comment //code removed for testing from constructor if
   testing is done.

 Above issues are resolved.
PFA the revised patch.


 On Tue, Nov 18, 2014 at 6:10 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Below are the thing I have taken care in this patch:

 1. While creating the new table using table wizard, when any variables
 or security labels are specified for certain column, those were not
 visible on *sql tab* of table wizard.
 2. when new/existing column dialog is open from table dialog then
 privileges and security labels in column dialog are not being persistent
 for new changes.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 18, 2014 at 5:54 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Akshay,

 PFA the patch.
 Please review it and let me know if anything is missing.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 11, 2014 at 7:21 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Apart from variable persistence issue taken care in your patch, I've
 also observed the data persistence issue with:
 (When reloading the existing/new column in column dialog from table
 dialog)
 1. Priviledges
 2. Security Lables

 I also observed, when I remove some privileges from an existing column,
 it generates SQL like, it needs to remove that column first, and then add
 that column, and the modify the new privileges.
 Can you also look into it?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 7:06 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Quick review suggests that, you're not following the consistent name
 convention in new functions as per pgAdmin3 coding standard.
 I also observed a white-space warning, while apply the patch.

 Please resend the patch after resolving these issues.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 5:25 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Issue was occurring as mentioned below:

 While creating the new table using table wizard, when any variables
 or security labels are specified for certain column then in
 *dlgTable* class, it was not fetching those variable or security
 labels from *dlgColumn *class. So those were not visible on *sql tab*
 of new table wizard.

 I have resolved that issue and created the patch for the same.
 Patch is attached with this mail. Please review it and if it looks
 good, please commit the code.




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:16 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Ashesh,

 I will check and get back.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:03 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sanket,

 Can you take a look at it?

 --
 Thanks,

 Ashesh Vashi

 On 4 Nov 2014 12:54, liuyuanyuan liuyuanyuang...@gmail.com
 wrote:
 
 
 
  Hi , hackers!
 
  Currently I test some part of pgadmin GUI, and I found some
 potential invalid input field of New Column GUI,
 
  Like Variables and Security Labels.
 Could you please have a look on this issue?
 
 
 
  For example:
 
  OS: WIN7 64bit
 
  PostgreSQL 9.3
 
  pgAdmin III:Version 1.18.1
 
  I use GUI of pgadmin to create table, and add column to this
 table (just as follow ). When I add a new column,
 
  I can add Variables (or Security Label )to this column, but
 finally in the tab SQL of New Table Interface I find nothing
 
  of  the Variables (or Security Label ) I’ve add. It seems that
 the Variables (or Security Label ) does not work.
 
 
 
  Best Wishes!
 
 
 
  Yours
 
  Jasmine Liu
 
 










 --
 *Akshay Joshi*
 *Principal Software Engineer *



 *Phone: +91 20-3058-9517Mobile: +91 976-788-8246

Re: [pgadmin-hackers] potential invalid input field of pgAdmin New Column GUI

2014-11-18 Thread Sanket Mehta
Hi Akshay,

PFA the patch.
Please review it and let me know if anything is missing.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Nov 11, 2014 at 7:21 PM, Ashesh Vashi ashesh.va...@enterprisedb.com
 wrote:

 Hi Sanket,

 Apart from variable persistence issue taken care in your patch, I've also
 observed the data persistence issue with:
 (When reloading the existing/new column in column dialog from table dialog)
 1. Priviledges
 2. Security Lables

 I also observed, when I remove some privileges from an existing column, it
 generates SQL like, it needs to remove that column first, and then add that
 column, and the modify the new privileges.
 Can you also look into it?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 7:06 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Quick review suggests that, you're not following the consistent name
 convention in new functions as per pgAdmin3 coding standard.
 I also observed a white-space warning, while apply the patch.

 Please resend the patch after resolving these issues.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 5:25 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Issue was occurring as mentioned below:

 While creating the new table using table wizard, when any variables or
 security labels are specified for certain column then in *dlgTable*
 class, it was not fetching those variable or security labels from *dlgColumn
 *class. So those were not visible on *sql tab* of new table wizard.

 I have resolved that issue and created the patch for the same.
 Patch is attached with this mail. Please review it and if it looks good,
 please commit the code.




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:16 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Ashesh,

 I will check and get back.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:03 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sanket,

 Can you take a look at it?

 --
 Thanks,

 Ashesh Vashi

 On 4 Nov 2014 12:54, liuyuanyuan liuyuanyuang...@gmail.com wrote:
 
 
 
  Hi , hackers!
 
  Currently I test some part of pgadmin GUI, and I found some
 potential invalid input field of New Column GUI,
 
  Like Variables and Security Labels.
 Could you please have a look on this issue?
 
 
 
  For example:
 
  OS: WIN7 64bit
 
  PostgreSQL 9.3
 
  pgAdmin III:Version 1.18.1
 
  I use GUI of pgadmin to create table, and add column to this table
 (just as follow ). When I add a new column,
 
  I can add Variables (or Security Label )to this column, but finally
 in the tab SQL of New Table Interface I find nothing
 
  of  the Variables (or Security Label ) I’ve add. It seems that the
 Variables (or Security Label ) does not work.
 
 
 
  Best Wishes!
 
 
 
  Yours
 
  Jasmine Liu
 
 








variable_and_privileges_issue.patch
Description: Binary data

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


Re: [pgadmin-hackers] potential invalid input field of pgAdmin New Column GUI

2014-11-18 Thread Sanket Mehta
Hi,

Below are the thing I have taken care in this patch:

1. While creating the new table using table wizard, when any variables or
security labels are specified for certain column, those were not
visible on *sql
tab* of table wizard.
2. when new/existing column dialog is open from table dialog then
privileges and security labels in column dialog are not being persistent
for new changes.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Nov 18, 2014 at 5:54 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi Akshay,

 PFA the patch.
 Please review it and let me know if anything is missing.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 11, 2014 at 7:21 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Apart from variable persistence issue taken care in your patch, I've also
 observed the data persistence issue with:
 (When reloading the existing/new column in column dialog from table
 dialog)
 1. Priviledges
 2. Security Lables

 I also observed, when I remove some privileges from an existing column,
 it generates SQL like, it needs to remove that column first, and then add
 that column, and the modify the new privileges.
 Can you also look into it?

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 7:06 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Sanket,

 Quick review suggests that, you're not following the consistent name
 convention in new functions as per pgAdmin3 coding standard.
 I also observed a white-space warning, while apply the patch.

 Please resend the patch after resolving these issues.

 --

 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 http://www.enterprisedb.com


 *http://www.linkedin.com/in/asheshvashi*
 http://www.linkedin.com/in/asheshvashi

 On Tue, Nov 11, 2014 at 5:25 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 Issue was occurring as mentioned below:

 While creating the new table using table wizard, when any variables or
 security labels are specified for certain column then in *dlgTable*
 class, it was not fetching those variable or security labels from 
 *dlgColumn
 *class. So those were not visible on *sql tab* of new table wizard.

 I have resolved that issue and created the patch for the same.
 Patch is attached with this mail. Please review it and if it looks
 good, please commit the code.




 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:16 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Ashesh,

 I will check and get back.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:03 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sanket,

 Can you take a look at it?

 --
 Thanks,

 Ashesh Vashi

 On 4 Nov 2014 12:54, liuyuanyuan liuyuanyuang...@gmail.com wrote:
 
 
 
  Hi , hackers!
 
  Currently I test some part of pgadmin GUI, and I found some
 potential invalid input field of New Column GUI,
 
  Like Variables and Security Labels.
 Could you please have a look on this issue?
 
 
 
  For example:
 
  OS: WIN7 64bit
 
  PostgreSQL 9.3
 
  pgAdmin III:Version 1.18.1
 
  I use GUI of pgadmin to create table, and add column to this table
 (just as follow ). When I add a new column,
 
  I can add Variables (or Security Label )to this column, but finally
 in the tab SQL of New Table Interface I find nothing
 
  of  the Variables (or Security Label ) I’ve add. It seems that the
 Variables (or Security Label ) does not work.
 
 
 
  Best Wishes!
 
 
 
  Yours
 
  Jasmine Liu
 
 









Re: [pgadmin-hackers] potential invalid input field of pgAdmin New Column GUI

2014-11-11 Thread Sanket Mehta
Hi,

Issue was occurring as mentioned below:

While creating the new table using table wizard, when any variables or
security labels are specified for certain column then in *dlgTable* class,
it was not fetching those variable or security labels from *dlgColumn *class.
So those were not visible on *sql tab* of new table wizard.

I have resolved that issue and created the patch for the same.
Patch is attached with this mail. Please review it and if it looks good,
please commit the code.




Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Nov 4, 2014 at 1:16 PM, Sanket Mehta sanket.me...@enterprisedb.com
wrote:

 Sure Ashesh,

 I will check and get back.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Nov 4, 2014 at 1:03 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sanket,

 Can you take a look at it?

 --
 Thanks,

 Ashesh Vashi

 On 4 Nov 2014 12:54, liuyuanyuan liuyuanyuang...@gmail.com wrote:
 
 
 
  Hi , hackers!
 
  Currently I test some part of pgadmin GUI, and I found some potential
 invalid input field of New Column GUI,
 
  Like Variables and Security Labels.
 Could you please have a look on this issue?
 
 
 
  For example:
 
  OS: WIN7 64bit
 
  PostgreSQL 9.3
 
  pgAdmin III:Version 1.18.1
 
  I use GUI of pgadmin to create table, and add column to this table
 (just as follow ). When I add a new column,
 
  I can add Variables (or Security Label )to this column, but finally in
 the tab SQL of New Table Interface I find nothing
 
  of  the Variables (or Security Label ) I’ve add. It seems that the
 Variables (or Security Label ) does not work.
 
 
 
  Best Wishes!
 
 
 
  Yours
 
  Jasmine Liu
 
 





variables_issue.patch
Description: Binary data

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


Re: [pgadmin-hackers] potential invalid input field of pgAdmin New Column GUI

2014-11-03 Thread Sanket Mehta
Sure Ashesh,

I will check and get back.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Nov 4, 2014 at 1:03 PM, Ashesh Vashi ashesh.va...@enterprisedb.com
wrote:

 Sanket,

 Can you take a look at it?

 --
 Thanks,

 Ashesh Vashi

 On 4 Nov 2014 12:54, liuyuanyuan liuyuanyuang...@gmail.com wrote:
 
 
 
  Hi , hackers!
 
  Currently I test some part of pgadmin GUI, and I found some potential
 invalid input field of New Column GUI,
 
  Like Variables and Security Labels.
 Could you please have a look on this issue?
 
 
 
  For example:
 
  OS: WIN7 64bit
 
  PostgreSQL 9.3
 
  pgAdmin III:Version 1.18.1
 
  I use GUI of pgadmin to create table, and add column to this table (just
 as follow ). When I add a new column,
 
  I can add Variables (or Security Label )to this column, but finally in
 the tab SQL of New Table Interface I find nothing
 
  of  the Variables (or Security Label ) I’ve add. It seems that the
 Variables (or Security Label ) does not work.
 
 
 
  Best Wishes!
 
 
 
  Yours
 
  Jasmine Liu
 
 




Re: [pgadmin-hackers] PATCH: Support smallserial columns in Edit Data window

2014-10-29 Thread Sanket Mehta
Hi J.F.,

Thank you for the explanation.
I have reviewed the patch.
It resolves both issues mentioned in the explanation.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Oct 28, 2014 at 10:16 PM, J.F. Oster jinfros...@mail.ru wrote:

 Hello Sanket,

 Steps to reveal issues:

 1. Prepare test tables:
 CREATE TABLE tserial2 (
   a smallserial NOT NULL,
   dat text,
   CONSTRAINT tserial2_pkey PRIMARY KEY (a)
 );

 -- Create these for reference (to compare):
 CREATE TABLE tserial(
   a serial NOT NULL,
   dat text,
   CONSTRAINT tserial_pkey PRIMARY KEY (a)
 );
 CREATE TABLE tserial8(
   a bigserial NOT NULL,
   dat text,
   CONSTRAINT tserial8_pkey PRIMARY KEY (a)
 );

 2. Open Edit data window for tserial2. Bug#1: the header for column a
 shows
 datatype smallint instead of smallserial.

 3. Insert one row into tserial2.

 4. Select whole new row by pressing on row header and copy it to
 clipboard (Ctrl-C or with context menu on row header).

 5. Move to last row (*) and Paste into it (Ctrl-V or context menu).
 Bug#2: A confirmation dialog should appear (This table contains
 serial ...), but it doesn't.


 Tuesday, October 28, 2014, 1:27:29 PM, you wrote:


 SM Can you please explain in which case it will create issue if bug is
 not applied?


 SM On Mon, Oct 27, 2014 at 4:14 PM, Dave Page dp...@pgadmin.org wrote:
 SM Ashesh, can you review/commit this please?

 SM On Fri, Oct 24, 2014 at 8:12 PM, J.F. Oster jinfros...@mail.ru
 wrote:
  Hello!
 
  This patch adds a few missing lines of code to handle smallserial
  columns the same way as serial and bigserial.
 

 --
 Best regards,
  J.F.




Re: [pgadmin-hackers] F8 for Execute to file

2014-10-28 Thread Sanket Mehta
Hi,

I have reviewed this patch.
It looks good to me.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 27, 2014 at 4:16 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh, can you review/commit this please?

 On Fri, Oct 24, 2014 at 10:57 PM, Mads Jensen m...@inducks.org wrote:
  Hi,
 
  It's a trivial patch: I miss a shortcut key for this function, and thus
  created a patch to support it.
 
  I don't get why this was:
  wxAcceleratorTable accel(12, entries);
  and not 14, as suggested in the manual:
 
  http://docs.wxwidgets.org/3.0/classwx_accelerator_table.html
 
  Thank you,
  --
  Med Venlig Hilsen / Kind regards,
  Mads Jensen
 
  Max Jerry Horovitz: Unfortunately, in America, babies are not found in
  cola cans. I asked my mother when I was four and she said they came from
  eggs laid by rabbis. If you aren't Jewish, they're laid by Catholic
  nuns. If you're an atheist, they're laid by dirty, lonely prostitutes.
   -- Mary and Max (2009)
 
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 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 (pgadmin-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgadmin-hackers



Re: [pgadmin-hackers] PATCH: Stored procedure large parameter list

2014-10-28 Thread Sanket Mehta
Hi

I have reviewed this patch.
This looks good to me.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 27, 2014 at 4:16 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh, can you review/commit this please?

 On Sun, Oct 26, 2014 at 5:51 AM, J.F. Oster jinfros...@mail.ru wrote:
  Hello!
 
  Please consider this patch. It's a small formatting improvement for
  pgFunction::GetSql() per discussion:
 
 http://www.postgresql.org/message-id/CAHYn==4bqljo5y+aganc-hwrtkhpyduueq_nvbpbpypb5jr...@mail.gmail.com
 
  --
  Best regards,
   J.F.
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 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 (pgadmin-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgadmin-hackers



Re: [pgadmin-hackers] PATCH: Clear undo/redo history when a file is opened in Query editor

2014-10-28 Thread Sanket Mehta
Hi,

As per my understanding below is the bug scenario.

- open any file in sql editor..
- now open a second file in same editor and try undo.
- it will show you previous file content again.

Let me know if my understanding is correct so that i can go ahead and
review the patch.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 27, 2014 at 4:14 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh, can you review/commit this please?

 On Fri, Oct 24, 2014 at 8:35 PM, J.F. Oster jinfros...@mail.ru wrote:
  Hello!
 
  A user may occasionaly assign content of a previously edited file into
  a next file opened in the same Query window, by calling Undo and Save.
 
  Simple non-MDI text editors (for example, notepad.exe) prevent an
  issue by clearing undo/redo history, so should we do.
  Please see the attached patch.
 
  --
  Best regards,
   J.F.
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 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 (pgadmin-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgadmin-hackers



Re: [pgadmin-hackers] PATCH: Support smallserial columns in Edit Data window

2014-10-28 Thread Sanket Mehta
Hi,

Can you please explain in which case it will create issue if bug is not
applied?



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 27, 2014 at 4:14 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh, can you review/commit this please?

 On Fri, Oct 24, 2014 at 8:12 PM, J.F. Oster jinfros...@mail.ru wrote:
  Hello!
 
  This patch adds a few missing lines of code to handle smallserial
  columns the same way as serial and bigserial.
 
 
  --
  Best regards,
   J.F.
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 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 (pgadmin-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgadmin-hackers



Re: [pgadmin-hackers] PATCH: Clear undo/redo history when a file is opened in Query editor

2014-10-28 Thread Sanket Mehta
Hi J.F.

Thank you for the clarification.
I have reviewed the patch.
It seems working fine.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Tue, Oct 28, 2014 at 9:38 PM, J.F. Oster jinfros...@mail.ru wrote:

 Hello Sanket,


 SM As per my understanding below is the bug scenario.
 Yes,

  - open any file in sql editor..
  - perform some modifications to file so that Undo is possible.
  - now open a second file in same editor and try Undo. It will show
you previous file content again.═
  - do Save.

 Now contents of the second file is replaced on disk with contents of
 the previous file.


 SM On Mon, Oct 27, 2014 at 4:14 PM, Dave Page dp...@pgadmin.org wrote:
 SM Ashesh, can you review/commit this please?

 SM On Fri, Oct 24, 2014 at 8:35 PM, J.F. Oster jinfros...@mail.ru
 wrote:
  Hello!
 
  A user may occasionaly assign content of a previously edited file into
  a next file opened in the same Query window, by calling Undo and Save.
 
  Simple non-MDI text editors (for example, notepad.exe) prevent an
  issue by clearing undo/redo history, so should we do.
  Please see the attached patch.
 


 --
 Best regards,
  J.F.




Re: [pgadmin-hackers] [pgadmin-support] pgAdmin 1.18.0 + slony-I 2.2.0 + PG 9.3

2014-10-27 Thread Sanket Mehta
Hi Dave,

I have reviewed the older patch, it looked good to me except one issue that
I have fixed.
I have attached the revised patch with this mail.



Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 27, 2014 at 3:16 PM, Akshay Joshi akshay.jo...@enterprisedb.com
 wrote:

 Adding Sanket

 He has already worked on it.

 On Tue, Feb 11, 2014 at 10:35 AM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Sure


 On Mon, Feb 10, 2014 at 8:00 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh; can you review this please?

 Thanks.


 On Fri, Feb 7, 2014 at 9:17 AM, Dinesh Kumar 
 dinesh.ku...@enterprisedb.com wrote:

 Hi Dave/Team,

 I would like to take the owner ship of this patch from now onwards.

 Sorry for my previous test case result, which is an improper one from
 my side. I believe, i need to configure the same slony version on PG 9.2 as
 well. It seems an expected behaviour if the slony version is not match.

 And also i have fixed one small version bug as below.

 BUG Details
 --
 After configuring the slony on PG 9.2 server follow the below steps.

 1. Launch pgadmin III
 2. Add New server and Right Click on Slony cluster node
 3. Click on Restart node
 4. Error occurred regarding procpid does not exist. (Image is attached)

 I have fixed this trivial bug on top of Neel's patch, and sending
 single patch for these two issues.

 Kindly let me know, if i miss anything here.

 Thanks in advance.

 Regards,
 Dinesh

 --
 *Dinesh Kumar*
 Software Engineer

 Ph: +918087463317
  Skype ID: dinesh.kumar432
 www.enterprisedb.co http://www.enterprisedb.com/m
 http://www.enterprisedb.com/

 *Follow us on Twitter*
 @EnterpriseDB

 Visit EnterpriseDB for tutorials, webinars, whitepapers
 http://www.enterprisedb.com/resources-community and more
 http://www.enterprisedb.com/resources-community


 On Tue, Dec 10, 2013 at 2:49 AM, Dinesh Kumar 
 dinesh.ku...@enterprisedb.com wrote:

 Hi Neel,

 On Mon, Nov 11, 2013 at 6:46 PM, Neel Patel 
 neel.pa...@enterprisedb.com wrote:

 Hi Ashesh,

 Please find the updated patch with below fix.

 -- Fix for slony version 1.2.23 with PG 9.0
 -- Picking the correct version of slony1_base.xxx.sql
 -- Fix the error no schema has been selected to create in. It
 gives error after deleting the slony cluster and again create thenew
 slony cluster.
 -- Fix for function storeNode() API which is accepting three
 arguments in slony version 1.1 and 1.2 and two arguments in
slony version 2.0 and above.

 Please let me know for any comments.


 I have tested this patch, and seems working fine. I have found one
 small issue when i try to create a new slony cluster with PG 9.2. When i 
 am
 trying to create a new cluster in PG 9.2 by setting the slony-path of PG
 9.3, then it' showing the
 ERROR:  could not access file $libdir/slony1_funcs.2.2.0: No such
 file or directory.

 Could you look into this as well.

 Thanks,
 Dinesh



 Thanks,
 Neel Patel


 On Thu, Oct 31, 2013 at 9:41 AM, Neel Patel 
 neel.pa...@enterprisedb.com wrote:

 Hi,

 Thanks Ashesh.

 I will check and let you know.

 Thanks,
 Neel Patel


 On Wed, Oct 30, 2013 at 5:19 PM, Ashesh Vashi 
 ashesh.va...@enterprisedb.com wrote:

 Hi Neel,

 I test the patch with following slony-I versions:
 1.2.27  (not working with PG 9.0)
 2.0.x(not picking correct slony1_base.xxx.sql - as per comment,
 it should pick slony1_base.v84.sql with PG 8.4 and above, but picking
 slony1_base.v83.sql)

 I have not tested further.
 Can you please take a look at it?



 On Tue, Oct 29, 2013 at 3:38 PM, Dave Page 
 dave.p...@enterprisedb.com wrote:

 Ashesh, can you look at this one as well please? Thanks.

 On Tue, Oct 22, 2013 at 8:34 AM, Neel Patel 
 neel.pa...@enterprisedb.com wrote:
  Hi Dave,
 
  We have fixed the below two issues to support in Slony version
 2.2.0 with PG
  9.3 in pgAdmin.
 
  Issue 1:-
 
  Bug to reproduce:-
 
  - Install PG 9.3 and slony 2.2.0
  - Right click on database and click on option New slony-I
 cluster...
  - In the dialog we are able to see the error in status bar
 saying Slony-I
  creation scripts not available; only joining possible
 
  Solution :-
 
  As per the above conversation in new version of slony 2.2.0
 installation
  name of the sql files got changed so it is not able to find the
 current
  slony version.
 
 
  Issue 2:-
 
  storenode API contains three argument in slony version 1.1 and
 1.2 but in
  slony version 2.0 onwards it contains only two arguments so that
 issue also
  fixed.
 
 
  As per our knowledge we have tested this patch in slony 2.2.0
 with PG 9.3.
 
  Can anyone please test this patch and let us know if any bugs.
 
 
  Thanks,
  Neel Patel
 
 
 
 
 
  On Fri, Oct 11, 2013 at 5:17 PM, Neel Patel 
 neel.pa...@enterprisedb.com
  wrote:
 
  Hi Sven,
 
  No idea regarding the next release.
 
  Thanks,
  Neel Patel
 
 
  On Fri, Oct 11, 2013 at 11:46 AM, Sven Meirsman 
 sven.meirs...@gmail.com
  wrote:
 
  Hi,
 
  Thanks for the feedback. I'm

Re: [pgadmin-hackers] PATCH: Fix Explain data output column not auto-sizing

2014-10-27 Thread Sanket Mehta
Hi,

I have reviewed the patch.
It looks good to me.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Mon, Oct 27, 2014 at 4:14 PM, Dave Page dp...@pgadmin.org wrote:

 Ashesh, can you review/commit this please?

 On Fri, Oct 24, 2014 at 6:02 PM, J.F. Oster jinfros...@mail.ru wrote:
  Hello!
 
  There is a small bug with Explain data output.
 
  Steps to reproduce:
 
  1. Open a new Query window.
  2. Perform Explain of any query. Switch to Data output tab. Column
  was auto-sized, ok.
  3. Execute the query.
  4. Perform Explain again. Switch to Data output tab. Column wasn't
  auto-sized this time, it is too narrow and user has to resize it
  manually.
 
  Here is a fix, please see attachment.
 
  --
  Best regards,
   J.F.
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers
 



 --
 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 (pgadmin-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgadmin-hackers



Re: [pgadmin-hackers] Fixed PPAS trigger column view condition

2014-10-13 Thread Sanket Mehta
Hi Dave,

per trigger column is available in PPAS since 8.5 (9.0) version.
It seems that it was wrongly assume by Guillaume Lelarge who has added
this check in pgadmin that is should not support per column trigger for
PPAS.
So the current patch is working for PG and PPAS both.

Please let me know if anything is missing.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

On Fri, Oct 10, 2014 at 9:24 PM, Dave Page dp...@pgadmin.org wrote:

 On Fri, Oct 10, 2014 at 1:35 PM, Sanket Mehta
 sanket.me...@enterprisedb.com wrote:
  Hi Dave,
 
  There is one issue with pgadmin while viewing the trigger definition
 created
  for PPAS server as below:
 
  CREATE OR REPLACE TRIGGER tr_a
BEFORE UPDATE OF cl1 ON a FOR EACH ROW
  begin
  if(:new.cl1  0) then
   insert into a values (:new.*);
   END if;
  END;
 
  after creating the trigger using above query,column name cl1(highlighted
  part above) is not visible in property window for that trigger.
 
  In current implementation, there is a condition:
 
  GetLanguage() != wxT(edbspl) in
 
   ShowTreeDetail() and ReadColumnDetails() functions in pgTrigger.cpp file
  which will prevent it to fetch column name in case db server is PPAS.
 
  I have removed that condition and tested it. It works fine now.
  I have attached the same patch with this mail for your reference.
  Please review it and if it looks good to you please do the needful.

 Are per-column triggers in PPAS something that's been added in a
 recent release? I wonder if there should be a version check in there,
 as the code was pretty clearly intended to be written as it is
 originally.


 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company



[pgadmin-hackers] Fixed PPAS trigger column view condition

2014-10-10 Thread Sanket Mehta
Hi Dave,

There is one issue with pgadmin while viewing the trigger definition
created for PPAS server as below:

CREATE OR REPLACE TRIGGER tr_a
  BEFORE UPDATE *OF cl1 *ON a FOR EACH ROW
begin
if(:new.cl1  0) then
 insert into a values (:new.*);
 END if;
END;

after creating the trigger using above query,column name *cl1*(highlighted
part above) is not visible in property window for that trigger.

In current implementation, there is a condition:

*GetLanguage() != wxT(edbspl**)* in

 *ShowTreeDetail()* and *ReadColumnDetails()* functions in pgTrigger.cpp
file which will prevent it to fetch column name in case db server is PPAS.

I have removed that condition and tested it. It works fine now.
I have attached the same patch with this mail for your reference.
Please review it and if it looks good to you please do the needful.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb


trigger_issue.patch
Description: Binary data

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


[pgadmin-hackers] Fixed PPAS trigger when condition

2014-09-19 Thread Sanket Mehta
Hi Dave

There is one issue with PPAS while trigger creation as mentioned below:

create table a (a int not null primary key, b int);
create table b (a int not null primary key, b int);
--make trigger with when condition
create trigger tr_a after insert on a for each row
when (:new.a  0)
begin
insert into b values (:new.*);
end;

After creating the trigger using above query, When condition is not visible
in property window of that trigger. As per current implementation, it
fetches the when part of trigger using below logic:

*substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE PROCEDURE') *

this will not work with PPAS as we have not provided any procedure to be
executed so it will return null. To fix this issue I have changed the above
logic as below:

*COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE
PROCEDURE'), substring(pg_get_triggerdef(t.oid), 'WHEN (.*)  \\$trigger')) *

Above logic has worked with PPAS and PG both. Attached is the patch file.

Please review it and if it looks good to you then please do commit the code


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb


ppas_trigger_when_issue.patch
Description: Binary data

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


  1   2   >