Re: Stalled post to pgsql-general

From: Ramesh T <rameshparnanditech(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Pavel Stěhule <pavel(dot)stehule(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: Stalled post to pgsql-general
Date: 2015-04-08 07:56:57
Message-ID: CAK8Zd=v2XmKADD2fbj3PzJAJZf9x7eJumGZXtV+jrdqkC39y=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes. Its working fine.
What i mean i created function to delete parts from table.Then i need to
place it on pgagent.

i placed function in pagent
like this..

do $$
declare
job_id int;
begin

/* add a job and get its id: */
insert into
pgagent.pga_job (jobjclid, jobname)
values
(1 /*1=Routine Maintenance*/, 'part delete')
returning
jobid
into
job_id;

/* add a step to the job: */
insert into
pgagent.pga_jobstep (jstjobid, jstname, jstkind, jstcode,
jstdbname)
values
( job_id,
'my step name',
's', /* sql step */
'do
$BODY$
BEGIN
perform delete_empty_parts();
end;
$BODY$', /* the sql to run */
'sakila' /* the name of the database to run
the step against */
);

/* add a schedule to the job. This one runs every minute: */
insert into
pgagent.pga_schedule (jscjobid, jscname)
values
(job_id, 'my schedule name');

end $$;

it sprogramatic way..

excuted fine.where i need to find this job.Jobs section..?,if yes unable to
see the job after excuted..please let me know where i need to excute and
where it is place..

2.is their any chance place *function *in pgagent directly in diagramatic
way ..?
like right click on job create job..
i think step-->defintion..

how to place it and can i select sql or batch..?

On Fri, Apr 3, 2015 at 3:50 PM, <pgsql-general-owner(at)postgresql(dot)org> wrote:

> Your message to pgsql-general has been delayed, and requires the approval
> of the moderators, for the following reason(s):
>
> The author (Ramesh T <rameshparnanditech(at)gmail(dot)com>)
> is not a member of any of the restrict_post groups.
>
> If you do not wish the message to be posted, or have other concerns,
> please send a message to the list owners at the following address:
> pgsql-general-owner(at)postgresql(dot)org
>
>
> ---------- Forwarded message ----------
> From: Ramesh T <rameshparnanditech(at)gmail(dot)com>
> To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org"
> <pgsql-general(at)postgresql(dot)org>
> Cc:
> Date: Fri, 3 Apr 2015 15:50:43 +0530
> Subject: Re:
> The link is good.
>
> But What I am expecting the following link..Created Using pgAgent.
>
> http://www.postgresonline.com/journal/archives/19-Setting-up-PgAgent-and-Doing-Scheduled-Backups.html
>
>
> in above link process they placed location of the script file at STEP
> DEFINTION TAB creation process..
>
> same way is there a chance to place creation of table or delete
> statements in pgAgent process..?
>
> my aim to create job is delete some null data from table daily
>
>
>
> On Fri, Apr 3, 2015 at 3:30 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>
>> Hi
>>
>>
>> http://stackoverflow.com/questions/4477301/creating-jobs-and-schedules-programatically-with-pgagent
>>
>> regards
>>
>> Pavel Stehule
>>
>> 2015-04-03 11:27 GMT+02:00 Ramesh T <rameshparnanditech(at)gmail(dot)com>:
>>
>>> Hi ,
>>> How to create job in pgAgent.Where I need to place script in
>>> pgAgent..any help
>>>
>>> Advanced thanks...
>>>
>>>
>>
>
>

Browse pgsql-general by date

  From Date Subject
Next Message Björn Lundin 2015-04-08 09:09:42 unexpected (to me) sorting order
Previous Message Jim Nasby 2015-04-08 05:14:16 Re: "could not split GIN page; no new items fit"