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 3d5e97892..4278c0fce 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/__init__.py @@ -215,7 +215,7 @@ class JobScheduleView(PGChildNodeView): """ sql = render_template( "/".join([self.template_path, self._PROPERTIES_SQL]), - jid=jid + jid=jid, conn=self.conn ) status, res = self.conn.execute_dict(sql) @@ -242,7 +242,8 @@ class JobScheduleView(PGChildNodeView): sql = render_template( "/".join([self.template_path, self._NODES_SQL]), jscid=jscid, - jid=jid + jid=jid, + conn=self.conn ) status, result = self.conn.execute_2darray(sql) @@ -298,7 +299,7 @@ class JobScheduleView(PGChildNodeView): """ sql = render_template( "/".join([self.template_path, self._PROPERTIES_SQL]), - jscid=jscid, jid=jid + jscid=jscid, jid=jid, conn=self.conn ) status, res = self.conn.execute_dict(sql) @@ -349,7 +350,8 @@ class JobScheduleView(PGChildNodeView): "/".join([self.template_path, self._CREATE_SQL]), jid=jid, data=data, - fetch_id=True + fetch_id=True, + conn=self.conn ) status, res = self.conn.execute_void('BEGIN') @@ -366,7 +368,8 @@ class JobScheduleView(PGChildNodeView): sql = render_template( "/".join([self.template_path, self._PROPERTIES_SQL]), jscid=res, - jid=jid + jid=jid, + conn=self.conn ) status, res = self.conn.execute_2darray(sql) @@ -419,7 +422,8 @@ class JobScheduleView(PGChildNodeView): "/".join([self.template_path, self._UPDATE_SQL]), jid=jid, jscid=jscid, - data=data + data=data, + conn=self.conn ) status, res = self.conn.execute_void(sql) @@ -430,7 +434,8 @@ class JobScheduleView(PGChildNodeView): sql = render_template( "/".join([self.template_path, self._PROPERTIES_SQL]), jscid=jscid, - jid=jid + jid=jid, + conn=self.conn ) status, res = self.conn.execute_2darray(sql) @@ -504,14 +509,16 @@ class JobScheduleView(PGChildNodeView): "/".join([self.template_path, self._CREATE_SQL]), jid=jid, data=data, - fetch_id=False + fetch_id=False, + conn=self.conn ) else: sql = render_template( "/".join([self.template_path, self._UPDATE_SQL]), jid=jid, jscid=jscid, - data=data + data=data, + conn=self.conn ) return make_json_response( diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/__init__.py b/web/pgadmin/browser/server_groups/servers/pgagent/steps/__init__.py index 34f6f7ebd..02128934a 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/__init__.py @@ -229,7 +229,8 @@ SELECT EXISTS( sql = render_template( "/".join([self.template_path, self._PROPERTIES_SQL]), jid=jid, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) status, res = self.conn.execute_dict(sql) @@ -257,7 +258,8 @@ SELECT EXISTS( sql = render_template( "/".join([self.template_path, self._NODES_SQL]), jstid=jstid, - jid=jid + jid=jid, + conn=self.conn ) status, result = self.conn.execute_2darray(sql) @@ -315,7 +317,8 @@ SELECT EXISTS( "/".join([self.template_path, self._PROPERTIES_SQL]), jstid=jstid, jid=jid, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) status, res = self.conn.execute_dict(sql) @@ -356,7 +359,8 @@ SELECT EXISTS( "/".join([self.template_path, self._CREATE_SQL]), jid=jid, data=data, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) status, res = self.conn.execute_scalar(sql) @@ -367,7 +371,8 @@ SELECT EXISTS( sql = render_template( "/".join([self.template_path, self._NODES_SQL]), jstid=res, - jid=jid + jid=jid, + conn=self.conn ) status, res = self.conn.execute_2darray(sql) @@ -415,7 +420,8 @@ SELECT EXISTS( "/".join([self.template_path, self._PROPERTIES_SQL]), jstid=jstid, jid=jid, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) status, res = self.conn.execute_dict(sql) @@ -439,7 +445,8 @@ SELECT EXISTS( jid=jid, jstid=jstid, data=data, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) status, res = self.conn.execute_void(sql) @@ -450,7 +457,8 @@ SELECT EXISTS( sql = render_template( "/".join([self.template_path, self._NODES_SQL]), jstid=jstid, - jid=jid + jid=jid, + conn=self.conn ) status, res = self.conn.execute_2darray(sql) @@ -522,7 +530,8 @@ SELECT EXISTS( "/".join([self.template_path, self._CREATE_SQL]), jid=jid, data=data, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) return make_json_response( @@ -539,7 +548,8 @@ SELECT EXISTS( "/".join([self.template_path, self._PROPERTIES_SQL]), jstid=jstid, jid=jid, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) status, res = self.conn.execute_dict(sql) @@ -563,7 +573,8 @@ SELECT EXISTS( jid=jid, jstid=jstid, data=data, - has_connstr=self.manager.db_info['pgAgent']['has_connstr'] + has_connstr=self.manager.db_info['pgAgent']['has_connstr'], + conn=self.conn ) return make_json_response( diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_exception.macros b/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_exception.macros index 4722f2b98..4dc128ea5 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_exception.macros +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_exception.macros @@ -1,7 +1,7 @@ {##################################################} {# This will be specific macro for pga_exception. #} {##################################################} -{% macro INSERT(jscid, data) -%} +{% macro INSERT(jscid, data, conn) -%} -- Inserting a schedule exception {% if jscid %}(schedule: {{ jscid|qtLiteral(conn)}}){% endif %} INSERT INTO pgagent.pga_exception ( @@ -11,14 +11,14 @@ INSERT INTO pgagent.pga_exception ( ); {%- endmacro %} -{% macro UPDATE(jscid, data) -%} +{% macro UPDATE(jscid, data, conn) -%} -- Updating an existing schedule exception (id: {{ data.jexid|qtLiteral(conn) }}, schedule: {{ jscid|qtLiteral(conn) }}) UPDATE pgagent.pga_exception SET {% if 'jexdate' in data %}jexdate={% if data.jexdate %}to_date({{ data.jexdate|qtLiteral(conn) }}, 'YYYY-MM-DD')::date{% else %}NULL::date{% endif %}{% endif %}{% if 'jextime' in data%}{% if 'jexdate' in data %}, {% endif %}jextime={% if data.jextime %}{{ data.jextime|qtLiteral(conn) }}::time without time zone{% else %}NULL::time without time zone{% endif %}{% endif %} WHERE jexid={{ data.jexid|qtLiteral(conn) }}::integer AND jexscid={{ jscid|qtLiteral(conn) }}::integer; {%- endmacro %} -{% macro DELETE(jscid, data) -%} +{% macro DELETE(jscid, data, conn) -%} -- Deleting a schedule exception (id: {{ data.jexid|qtLiteral(conn) }}, schedule: {{ jscid|qtLiteral(conn) }}) DELETE FROM pgagent.pga_exception WHERE jexid={{ data.jexid|qtLiteral(conn) }}::integer AND jexscid={{ jscid|qtLiteral(conn) }}::integer; {%- endmacro %} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_jobstep.macros b/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_jobstep.macros index 6a8740ded..415c21b04 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_jobstep.macros +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_jobstep.macros @@ -1,7 +1,7 @@ {################################################} {# This will be specific macro for pga_jobstep. #} {################################################} -{% macro INSERT(has_connstr, jid, data) -%} +{% macro INSERT(has_connstr, jid, data, conn) -%} -- Inserting a step (jobid: {{ jid|qtLiteral(conn) }}) INSERT INTO pgagent.pga_jobstep ( jstjobid, jstname, jstenabled, jstkind, @@ -13,7 +13,7 @@ INSERT INTO pgagent.pga_jobstep ( {{ data.jstcode|qtLiteral(conn) }}::text, {{ data.jstdesc|qtLiteral(conn) }}::text ) {% if jid %}RETURNING jstid{% endif %}; {%- endmacro %} -{% macro UPDATE(has_connstr, jid, jstid, data) -%} +{% macro UPDATE(has_connstr, jid, jstid, data, conn) -%} {% if 'jstname' in data or 'jstenabled' in data or 'jstdesc' in data or 'jstonerror' in data or 'jstcode' in data %} {% set is_comma_required = True %} {% else %} @@ -36,11 +36,11 @@ SET WHERE jstid={{ jstid|qtLiteral(conn) }}::integer AND jstjobid={{ jid|qtLiteral(conn) }}::integer; {%- endmacro %} -{% macro DELETE(jid, jstid) -%} +{% macro DELETE(jid, jstid, conn) -%} -- Deleting a step (id: {{ jstid|qtLiteral(conn) }}, jobid: {{ jid|qtLiteral(conn) }}) DELETE FROM pgagent.pga_jobstep WHERE jstid={{ jstid|qtLiteral(conn) }}::integer AND jstjobid={{ jid|qtLiteral(conn) }}::integer; {%- endmacro %} -{% macro PROPERTIES(has_connstr, jid, jstid) -%} +{% macro PROPERTIES(has_connstr, jid, jstid, conn) -%} SELECT jstid, jstjobid, jstname, jstdesc, jstenabled, jstkind = 's'::bpchar as jstkind, jstcode, CASE WHEN (jstdbname != '' OR jstkind = 'b'::bpchar) THEN true ELSE false END AS jstconntype, diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_schedule.macros b/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_schedule.macros index 017a8ae31..730255014 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_schedule.macros +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/macros/pga_schedule.macros @@ -2,7 +2,7 @@ {# This will be specific macro for pga_schedule. #} {#################################################} {% import 'macros/pga_exception.macros' as EXCEPTIONS %} -{% macro INSERT(jid, data) -%} +{% macro INSERT(jid, data, conn) -%} -- Inserting a schedule{% if jid %} (jobid: {{ jid|qtLiteral(conn) }}){% endif %} INSERT INTO pgagent.pga_schedule( @@ -26,9 +26,9 @@ INSERT INTO pgagent.pga_schedule( ) RETURNING jscid INTO scid;{% if 'jscexceptions' in data %} {% for exc in data.jscexceptions %} -{{ EXCEPTIONS.INSERT(None, exc) }}{% endfor %}{% endif %} +{{ EXCEPTIONS.INSERT(None, exc, conn) }}{% endfor %}{% endif %} {%- endmacro %} -{% macro UPDATE(jid, jscid, data) -%} +{% macro UPDATE(jid, jscid, data, conn) -%} {% if 'jscname' in data or 'jscenabled' in data or 'jscdesc' in data or 'jscstart' in data or 'jscend' in data or 'jscmonths' in data or 'jscminutes' in data or 'jscmonthdays' in data or 'jschours' in data or 'jscweekdays' in data %} -- Updating the schedule (id: {{ jscid|qtLiteral(conn) }}, jobid: {{ jid|qtLiteral(conn) }}) @@ -59,31 +59,31 @@ WHERE jscid={{ jscid|qtLiteral(conn) }}::integer AND jscjobid={{ jid|qtLiteral(c {% if 'added' in data.jscexceptions and data.jscexceptions.added|length > 0 %} {% for exc in data.jscexceptions.added %} -{{ EXCEPTIONS.INSERT(jscid, exc) }} +{{ EXCEPTIONS.INSERT(jscid, exc, conn) }} {% endfor %} {% endif %} {% if 'deleted' in data.jscexceptions and data.jscexceptions.deleted|length > 0 %} {% for exc in data.jscexceptions.deleted %} -{{ EXCEPTIONS.DELETE(jscid, exc) }} +{{ EXCEPTIONS.DELETE(jscid, exc, conn) }} {% endfor %} {% endif %} {% if 'changed' in data.jscexceptions and data.jscexceptions.changed|length > 0 %} {% for exc in data.jscexceptions.changed %} -{{ EXCEPTIONS.UPDATE(jscid, exc) }} +{{ EXCEPTIONS.UPDATE(jscid, exc, conn) }} {% endfor %} {% endif %} {% endif %} {%- endmacro %} -{% macro DELETE(jid, jscid) -%} +{% macro DELETE(jid, jscid, conn) -%} -- Removing the existing schedule (id: {{ jscid|qtLiteral(conn) }}, jobid: {{ jid|qtLiteral(conn) }}) DELETE FROM pgagent.pga_schedule WHERE jscid={{ jscid|qtLiteral(conn) }}::integer AND jscjobid={{ jid|qtLiteral(conn) }}::integer; {%- endmacro %} {% macro FETCH_CURRENT() -%} SELECT jscid FROM pgagent.pga_schedule WHERE xmin::text = (txid_current() % (2^32)::bigint)::text; {%- endmacro %} -{% macro PROPERTIES(jid, jscid) -%} +{% macro PROPERTIES(jid, jscid, conn) -%} SELECT jscid, jscjobid, jscname, jscdesc, jscenabled, jscstart, jscend, jscminutes, jschours, jscweekdays, jscmonthdays, jscmonths, diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/create.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/create.sql index 911f452b8..62d4e95ca 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/create.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/create.sql @@ -17,12 +17,12 @@ INSERT INTO pgagent.pga_job( -- Steps -{% for step in data.jsteps %}{{ STEP.INSERT(has_connstr, None, step) }}{% endfor %} +{% for step in data.jsteps %}{{ STEP.INSERT(has_connstr, None, step, conn) }}{% endfor %} {% endif %}{% if 'jschedules' in data and data.jschedules|length > 0 %} -- Schedules -{% for schedule in data.jschedules %}{{ SCHEDULE.INSERT(None, schedule) }}{% endfor %} +{% for schedule in data.jschedules %}{{ SCHEDULE.INSERT(None, schedule, conn) }}{% endfor %} {% endif %} END diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/schedules.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/schedules.sql index 3700dcd4a..0bc553329 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/schedules.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/schedules.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_schedule.macros' as SCHEDULE %} -{{ SCHEDULE.PROPERTIES(jid, jscid) }} +{{ SCHEDULE.PROPERTIES(jid, jscid, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/steps.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/steps.sql index 60c3eceba..422a3f633 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/steps.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/steps.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_jobstep.macros' as STEP %} -{{ STEP.PROPERTIES(has_connstr, jid, jstid) }} +{{ STEP.PROPERTIES(has_connstr, jid, jstid, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/update.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/update.sql index 48e81c34a..6c859de86 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/update.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_job/sql/pre3.4/update.sql @@ -11,19 +11,19 @@ SET {% if 'jobjclid' in data %}jobjclid={{ data.jobjclid|qtLiteral(conn) }}::int WHERE jobid = {{ jid }}; {% endif %}{% if 'jsteps' in data %} -{% if 'deleted' in data.jsteps %}{% for step in data.jsteps.deleted %}{{ STEP.DELETE(jid, step.jstid) }}{% endfor %}{% endif %} -{% if 'changed' in data.jsteps %}{% for step in data.jsteps.changed %}{{ STEP.UPDATE(has_connstr, jid, step.jstid, step) }}{% endfor %}{% endif %} -{% if 'added' in data.jsteps %}{% for step in data.jsteps.added %}{{ STEP.INSERT(has_connstr, jid, step) }}{% endfor %}{% endif %}{% endif %}{% if 'jschedules' in data %} +{% if 'deleted' in data.jsteps %}{% for step in data.jsteps.deleted %}{{ STEP.DELETE(jid, step.jstid, conn) }}{% endfor %}{% endif %} +{% if 'changed' in data.jsteps %}{% for step in data.jsteps.changed %}{{ STEP.UPDATE(has_connstr, jid, step.jstid, step, conn) }}{% endfor %}{% endif %} +{% if 'added' in data.jsteps %}{% for step in data.jsteps.added %}{{ STEP.INSERT(has_connstr, jid, step, conn) }}{% endfor %}{% endif %}{% endif %}{% if 'jschedules' in data %} -{% if 'deleted' in data.jschedules %}{% for schedule in data.jschedules.deleted %}{{ SCHEDULE.DELETE(jid, schedule.jscid) }}{% endfor %}{% endif %} -{% if 'changed' in data.jschedules %}{% for schedule in data.jschedules.changed %}{{ SCHEDULE.UPDATE(jid, schedule.jscid, schedule) }}{% endfor %}{% endif %} +{% if 'deleted' in data.jschedules %}{% for schedule in data.jschedules.deleted %}{{ SCHEDULE.DELETE(jid, schedule.jscid, conn) }}{% endfor %}{% endif %} +{% if 'changed' in data.jschedules %}{% for schedule in data.jschedules.changed %}{{ SCHEDULE.UPDATE(jid, schedule.jscid, schedule, conn) }}{% endfor %}{% endif %} {% if 'added' in data.jschedules %} DO $$ DECLARE scid integer; BEGIN -{% for schedule in data.jschedules.added %}{{ SCHEDULE.INSERT(jid, schedule) }}{% endfor %} +{% for schedule in data.jschedules.added %}{{ SCHEDULE.INSERT(jid, schedule, conn) }}{% endfor %} END $$; {% endif %} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/create.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/create.sql index 4dd2172de..c5002ee42 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/create.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/create.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_jobstep.macros' as STEP %} -{{ STEP.INSERT(has_connstr, jid, data) }} +{{ STEP.INSERT(has_connstr, jid, data, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/delete.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/delete.sql index 59db1acd1..7a8e45fa1 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/delete.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/delete.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_jobstep.macros' as STEP %} -{{ STEP.DELETE(jid, jstid) }} +{{ STEP.DELETE(jid, jstid, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/properties.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/properties.sql index 60c3eceba..422a3f633 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/properties.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_jobstep.macros' as STEP %} -{{ STEP.PROPERTIES(has_connstr, jid, jstid) }} +{{ STEP.PROPERTIES(has_connstr, jid, jstid, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/update.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/update.sql index 316355e72..e3ab0be1b 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/update.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_jobstep/sql/pre3.4/update.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_jobstep.macros' as STEP %} -{{ STEP.UPDATE(has_connstr, jid, jstid, data) }} +{{ STEP.UPDATE(has_connstr, jid, jstid, data, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/create.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/create.sql index a4ddbc6f5..238f6a0ff 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/create.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/create.sql @@ -3,7 +3,7 @@ DO $$ DECLARE scid integer; BEGIN -{{ SCHEDULE.INSERT(jid, data) }} +{{ SCHEDULE.INSERT(jid, data, conn) }} END $$;{% if fetch_id %} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/delete.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/delete.sql index cf43071e3..6ba9ef990 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/delete.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/delete.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_schedule.macros' as SCHEDULE %} -{{ SCHEDULE.DELETE(jid, jscid) }} +{{ SCHEDULE.DELETE(jid, jscid, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/properties.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/properties.sql index 3700dcd4a..0bc553329 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/properties.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_schedule.macros' as SCHEDULE %} -{{ SCHEDULE.PROPERTIES(jid, jscid) }} +{{ SCHEDULE.PROPERTIES(jid, jscid, conn) }} diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/update.sql b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/update.sql index e8fb7cbba..44d6965bd 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/update.sql +++ b/web/pgadmin/browser/server_groups/servers/pgagent/templates/pga_schedule/sql/pre3.4/update.sql @@ -1,2 +1,2 @@ {% import 'macros/pga_schedule.macros' as SCHEDULE %} -{{ SCHEDULE.UPDATE(jid, jscid, data) }} +{{ SCHEDULE.UPDATE(jid, jscid, data, conn) }}