Re: pgagent status always successful

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: <erics(at)ameri-title(dot)com>, pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: pgagent status always successful
Date: 2006-07-05 19:23:51
Message-ID: C0D1D057.E88A%dpage@vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On 5/7/06 19:34, "Eric Shuman" <erics(at)ameri-title(dot)com> wrote:

> Hi Dave,
>
> I think I got the patch installed via Raphaël's instructions. I seem to now
> get a result code for my step, but the status for the step and job is still
> "successful". Also, the result code returned is not the same as the exit code
> for the script (is it supposed to be???).
>

Hi Eric,

If the script can be executed successfully (ie. It was created and run on
the host machine by pgAgent), then the result status code will be whatever
is returned by the pclose() call the corresponds to the popen() used to
execute the script.

If pgAgent cannot run the script (because it can't create a temporary
directory and file for example), it will return -1.

So, if you're seeing a -1 return value, run pgAgent with the log level set
to show at least warnings and you should see an error message if pgAgent is
having trouble. Otherwise, see 'man 3 pclose' which should tell you what
your system's pclose does.

As for failing the job, do you have 'On Error' set to 'Fail' for that step?

Regards, Dave.

PS. I'm off to the PostgreSQL conference in Toronto tomorrow so might not be
around much for the next week or so.

Browse pgadmin-support by date

  From Date Subject
Next Message Melvin Davidson 2006-07-06 21:43:48 Detemine name of replication schema
Previous Message Tomi NA 2006-07-05 07:47:23 Re: How to access table from one database to another database