Re: [pgadmin-hackers] Patch for pgagent RM1878 [pgAgent]

2016-10-24 Thread Dave Page
On Mon, Oct 24, 2016 at 4:14 PM, Harshal Dhumal
 wrote:
> Hi Dave,
>
>
> --
> Harshal Dhumal
> Software Engineer
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Oct 24, 2016 at 1:34 PM, Dave Page  wrote:
>>
>> Hi
>>
>> On Mon, Oct 24, 2016 at 7:27 AM, Harshal Dhumal
>>  wrote:
>> > Hi Dave,
>> >
>> > I mean reverse engineered sql tab. Currently it's not implemented for
>> > both
>> > pgagent schedule and jobs.
>>
>> Yes it is - that's the change I made to your patch: "one change to
>> *enable* the SQL tabs everywhere".
>
>
> Ok.
>>
>>
>> > I have created Rm for that  RM1891
>>
>> Please confirm it's working now, and update the ticket accordingly. It
>> won't hurt to have that listed as a separate change for 1.1.
>
>
> SQL tab in create and update properties mode works properly also Fahar
> tested and closed same issue.
>
> The ticket 1891 is for reverse engineered SQL. Currently it's giving 404
> error when reverse engineered SQL tab is selected for schedule or job. I
> have also attached screen shot in RM1891.
>
> In pgadmin3 I can't see reverse engineered SQL for both schedule or jobs. So
> I'm confused whether we need to add implementation of same in pgAdmin4 or
> disabled reverse engineered SQL.

Oh, I see - yes, I'd like to generate it for consistency with other
object types.


-- 
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 for pgagent RM1878 [pgAgent]

2016-10-24 Thread Harshal Dhumal
Hi Dave,


-- 
*Harshal Dhumal*
*Software Engineer*

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

On Mon, Oct 24, 2016 at 1:34 PM, Dave Page  wrote:

> Hi
>
> On Mon, Oct 24, 2016 at 7:27 AM, Harshal Dhumal
>  wrote:
> > Hi Dave,
> >
> > I mean reverse engineered sql tab. Currently it's not implemented for
> both
> > pgagent schedule and jobs.
>
> Yes it is - that's the change I made to your patch: "one change to
> *enable* the SQL tabs everywhere".


Ok.

>
> > I have created Rm for that  RM1891
>
> Please confirm it's working now, and update the ticket accordingly. It
> won't hurt to have that listed as a separate change for 1.1.
>

SQL tab in create and update properties mode works properly also Fahar
tested and closed same issue.

The ticket 1891 is for reverse engineered SQL. Currently it's giving 404
error when reverse engineered SQL tab is selected for schedule or job. I
have also attached screen shot in RM1891
.

In pgadmin3 I can't see reverse engineered SQL for both schedule or jobs.
So I'm confused whether we need to add implementation of same in pgAdmin4
or disabled reverse engineered SQL.


> > On Fri, Oct 21, 2016 at 8:30 PM, Dave Page  wrote:
> >>
> >> Thanks - applied, with one change to *enable* the SQL tabs everywhere.
> >>
> >> On Fri, Oct 21, 2016 at 2:41 PM, Harshal Dhumal
> >>  wrote:
> >> > Hi,
> >> >
> >> > PFA updated patch for RM1878
> >> >
> >> > Issues fixed:
> >> >
> >> > 1. ProgrammingError: can't adapt type 'Undefined' for schedule
> >> > 2. Fixed malformed array literal issue raised by postgres while
> creating
> >> > schedule
> >> > 3. Fixed update of schedule.
> >> > 4. Fixed update of step.
> >> > 5. disabled sql tab (create sql tab) for step.
> >> >
> >> > --
> >> > Harshal Dhumal
> >> > Software Engineer
> >> >
> >> > EnterpriseDB India: http://www.enterprisedb.com
> >> > The Enterprise PostgreSQL Company
> >> >
> >> > On Fri, Oct 21, 2016 at 4:11 PM, Harshal Dhumal
> >> >  wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> Please ignore this patch as I haven't fixed same issue for schedule.
> >> >> Also
> >> >> there is issue "malformed array literal" when we try to save
> schedule.
> >> >>
> >> >> I'll be sending updated patch.
> >> >>
> >> >> Thanks Harshal,
> >> >>
> >> >> --
> >> >> Harshal Dhumal
> >> >> Software Engineer
> >> >>
> >> >> EnterpriseDB India: http://www.enterprisedb.com
> >> >> The Enterprise PostgreSQL Company
> >> >>
> >> >> On Fri, Oct 21, 2016 at 2:51 PM, Harshal Dhumal
> >> >>  wrote:
> >> >>>
> >> >>> Hi,
> >> >>>
> >> >>> PFA attached patch for pgagent issue RM1878
> >> >>>
> >> >>> issue fixed: ProgrammingError: can't adapt type 'Undefined'
> >> >>>
> >> >>> --
> >> >>> Harshal Dhumal
> >> >>> Software Engineer
> >> >>>
> >> >>> EnterpriseDB India: 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
> >> >
> >>
> >>
> >>
> >> --
> >> 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 for pgagent RM1878 [pgAgent]

2016-10-24 Thread Dave Page
Hi

On Mon, Oct 24, 2016 at 7:27 AM, Harshal Dhumal
 wrote:
> Hi Dave,
>
> I mean reverse engineered sql tab. Currently it's not implemented for both
> pgagent schedule and jobs.

Yes it is - that's the change I made to your patch: "one change to
*enable* the SQL tabs everywhere".

> I have created Rm for that  RM1891

Please confirm it's working now, and update the ticket accordingly. It
won't hurt to have that listed as a separate change for 1.1.

> On Fri, Oct 21, 2016 at 8:30 PM, Dave Page  wrote:
>>
>> Thanks - applied, with one change to *enable* the SQL tabs everywhere.
>>
>> On Fri, Oct 21, 2016 at 2:41 PM, Harshal Dhumal
>>  wrote:
>> > Hi,
>> >
>> > PFA updated patch for RM1878
>> >
>> > Issues fixed:
>> >
>> > 1. ProgrammingError: can't adapt type 'Undefined' for schedule
>> > 2. Fixed malformed array literal issue raised by postgres while creating
>> > schedule
>> > 3. Fixed update of schedule.
>> > 4. Fixed update of step.
>> > 5. disabled sql tab (create sql tab) for step.
>> >
>> > --
>> > Harshal Dhumal
>> > Software Engineer
>> >
>> > EnterpriseDB India: http://www.enterprisedb.com
>> > The Enterprise PostgreSQL Company
>> >
>> > On Fri, Oct 21, 2016 at 4:11 PM, Harshal Dhumal
>> >  wrote:
>> >>
>> >> Hi,
>> >>
>> >> Please ignore this patch as I haven't fixed same issue for schedule.
>> >> Also
>> >> there is issue "malformed array literal" when we try to save schedule.
>> >>
>> >> I'll be sending updated patch.
>> >>
>> >> Thanks Harshal,
>> >>
>> >> --
>> >> Harshal Dhumal
>> >> Software Engineer
>> >>
>> >> EnterpriseDB India: http://www.enterprisedb.com
>> >> The Enterprise PostgreSQL Company
>> >>
>> >> On Fri, Oct 21, 2016 at 2:51 PM, Harshal Dhumal
>> >>  wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> PFA attached patch for pgagent issue RM1878
>> >>>
>> >>> issue fixed: ProgrammingError: can't adapt type 'Undefined'
>> >>>
>> >>> --
>> >>> Harshal Dhumal
>> >>> Software Engineer
>> >>>
>> >>> EnterpriseDB India: 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
>> >
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



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

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


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


Re: [pgadmin-hackers] Patch for pgagent RM1878 [pgAgent]

2016-10-24 Thread Harshal Dhumal
Hi Dave,

I mean reverse engineered sql tab. Currently it's not implemented for both
pgagent schedule and jobs.

I have created Rm for that  RM1891


-- 
*Harshal Dhumal*
*Software Engineer*

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

On Fri, Oct 21, 2016 at 8:30 PM, Dave Page  wrote:

> Thanks - applied, with one change to *enable* the SQL tabs everywhere.
>
> On Fri, Oct 21, 2016 at 2:41 PM, Harshal Dhumal
>  wrote:
> > Hi,
> >
> > PFA updated patch for RM1878
> >
> > Issues fixed:
> >
> > 1. ProgrammingError: can't adapt type 'Undefined' for schedule
> > 2. Fixed malformed array literal issue raised by postgres while creating
> > schedule
> > 3. Fixed update of schedule.
> > 4. Fixed update of step.
> > 5. disabled sql tab (create sql tab) for step.
> >
> > --
> > Harshal Dhumal
> > Software Engineer
> >
> > EnterpriseDB India: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
> >
> > On Fri, Oct 21, 2016 at 4:11 PM, Harshal Dhumal
> >  wrote:
> >>
> >> Hi,
> >>
> >> Please ignore this patch as I haven't fixed same issue for schedule.
> Also
> >> there is issue "malformed array literal" when we try to save schedule.
> >>
> >> I'll be sending updated patch.
> >>
> >> Thanks Harshal,
> >>
> >> --
> >> Harshal Dhumal
> >> Software Engineer
> >>
> >> EnterpriseDB India: http://www.enterprisedb.com
> >> The Enterprise PostgreSQL Company
> >>
> >> On Fri, Oct 21, 2016 at 2:51 PM, Harshal Dhumal
> >>  wrote:
> >>>
> >>> Hi,
> >>>
> >>> PFA attached patch for pgagent issue RM1878
> >>>
> >>> issue fixed: ProgrammingError: can't adapt type 'Undefined'
> >>>
> >>> --
> >>> Harshal Dhumal
> >>> Software Engineer
> >>>
> >>> EnterpriseDB India: 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
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] Patch for pgagent RM1878 [pgAgent]

2016-10-21 Thread Dave Page
Thanks - applied, with one change to *enable* the SQL tabs everywhere.

On Fri, Oct 21, 2016 at 2:41 PM, Harshal Dhumal
 wrote:
> Hi,
>
> PFA updated patch for RM1878
>
> Issues fixed:
>
> 1. ProgrammingError: can't adapt type 'Undefined' for schedule
> 2. Fixed malformed array literal issue raised by postgres while creating
> schedule
> 3. Fixed update of schedule.
> 4. Fixed update of step.
> 5. disabled sql tab (create sql tab) for step.
>
> --
> Harshal Dhumal
> Software Engineer
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Fri, Oct 21, 2016 at 4:11 PM, Harshal Dhumal
>  wrote:
>>
>> Hi,
>>
>> Please ignore this patch as I haven't fixed same issue for schedule. Also
>> there is issue "malformed array literal" when we try to save schedule.
>>
>> I'll be sending updated patch.
>>
>> Thanks Harshal,
>>
>> --
>> Harshal Dhumal
>> Software Engineer
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Fri, Oct 21, 2016 at 2:51 PM, Harshal Dhumal
>>  wrote:
>>>
>>> Hi,
>>>
>>> PFA attached patch for pgagent issue RM1878
>>>
>>> issue fixed: ProgrammingError: can't adapt type 'Undefined'
>>>
>>> --
>>> Harshal Dhumal
>>> Software Engineer
>>>
>>> EnterpriseDB India: 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
>



-- 
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 for pgagent RM1878 [pgAgent]

2016-10-21 Thread Harshal Dhumal
Hi,

PFA updated patch for RM1878

Issues fixed:

1. ProgrammingError: can't adapt type 'Undefined' for schedule
2. Fixed malformed array literal issue raised by postgres while creating
schedule
3. Fixed update of schedule.
4. Fixed update of step.
5. disabled sql tab (create sql tab) for step.

-- 
*Harshal Dhumal*
*Software Engineer*

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

On Fri, Oct 21, 2016 at 4:11 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please ignore this patch as I haven't fixed same issue for schedule. Also
> there is issue "malformed array literal" when we try to save schedule.
>
> I'll be sending updated patch.
>
> Thanks Harshal,
>
> --
> *Harshal Dhumal*
> *Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Fri, Oct 21, 2016 at 2:51 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA attached patch for pgagent issue RM1878
>>
>> issue fixed: ProgrammingError: can't adapt type 'Undefined'
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/__init__.py b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/__init__.py
index 24ea1ba..4dd82e8 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/__init__.py
@@ -219,8 +219,8 @@ class JobScheduleView(PGChildNodeView):
 res = []
 sql = render_template(
 "/".join([self.template_path, 'nodes.sql']),
-jscid = jscid,
-jid = jid
+jscid=jscid,
+jid=jid
 )
 
 status, result = self.conn.execute_2darray(sql)
@@ -298,13 +298,22 @@ class JobScheduleView(PGChildNodeView):
 jid: Job ID
 """
 data = {}
-for k, v in request.args.items():
-try:
-data[k] = json.loads(
-v.decode('utf-8') if hasattr(v, 'decode') else v
-)
-except ValueError:
-data[k] = v
+if request.args:
+for k, v in request.args.items():
+try:
+data[k] = json.loads(
+v.decode('utf-8') if hasattr(v, 'decode') else v
+)
+except ValueError:
+data[k] = v
+else:
+data = json.loads(request.data.decode())
+# convert python list literal to postgres array literal.
+data['jscminutes'] = data['jscminutes'].replace("[", "{").replace("]", "}")
+data['jschours'] = data['jschours'].replace("[", "{").replace("]", "}")
+data['jscweekdays'] = data['jscweekdays'].replace("[", "{").replace("]", "}")
+data['jscmonthdays'] = data['jscmonthdays'].replace("[", "{").replace("]", "}")
+data['jscmonths'] = data['jscmonths'].replace("[", "{").replace("]", "}")
 
 sql = render_template(
 "/".join([self.template_path, 'create.sql']),
@@ -327,8 +336,8 @@ class JobScheduleView(PGChildNodeView):
 self.conn.execute_void('END')
 sql = render_template(
 "/".join([self.template_path, 'nodes.sql']),
-jscid = res,
-jid = jid
+jscid=res,
+jid=jid
 )
 status, res = self.conn.execute_2darray(sql)
 
@@ -357,17 +366,36 @@ class JobScheduleView(PGChildNodeView):
 jscid: JobSchedule ID
 """
 data = {}
-for k, v in request.args.items():
-try:
-data[k] = json.loads(
-v.decode('utf-8') if hasattr(v, 'decode') else v
-)
-except ValueError:
-data[k] = v
+if request.args:
+for k, v in request.args.items():
+try:
+data[k] = json.loads(
+v.decode('utf-8') if hasattr(v, 'decode') else v
+)
+except ValueError:
+data[k] = v
+else:
+data = json.loads(request.data.decode())
+# convert python list literal to postgres array literal.
+if 'jscminutes' in data:
+data['jscminutes'] = data['jscminutes'].replace("[", "{").replace("]", "}")
+
+if 'jschours' in data:
+data['jschours'] = data['jschours'].replace("[", "{").replace("]", "}")
+
+if 'jscweekdays' in data:
+data['jscweekdays'] = data['jscweekdays'].replace("[", "{").replace("]", "}")
+
+if 'jscmonthdays' in data:
+data['jscmonthdays'] = data['jscmonthdays'].replace("[", "{").replace("]", "}")
+
+if 'jscmonths' 

Re: [pgadmin-hackers] Patch for pgagent RM1878 [pgAgent]

2016-10-21 Thread Harshal Dhumal
Hi,

Please ignore this patch as I haven't fixed same issue for schedule. Also
there is issue "malformed array literal" when we try to save schedule.

I'll be sending updated patch.

Thanks Harshal,

-- 
*Harshal Dhumal*
*Software Engineer*

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

On Fri, Oct 21, 2016 at 2:51 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA attached patch for pgagent issue RM1878
>
> issue fixed: ProgrammingError: can't adapt type 'Undefined'
>
> --
> *Harshal Dhumal*
> *Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>