0

I have created a job scheduler using pgagent in postgresql:

What I did is mentioned as screen shots job

step

step query Schedule

I had created like this to update name in my database field in a certain time. But when I check it is getting failed. The failed status as follows: Failed status step result What I did wrong? How can I correct it?

Santhucool
  • 1,656
  • 2
  • 36
  • 92
  • Could you comment on 'what' is 'getting failed'. Does it run? If so, is there an error? If so, what does it exactly say? If it doesn't run, are you sure you're taking care of things like timezones (for e.g. server and client being in different timezones)? – Robins Tharakan Jan 15 '15 at 11:30
  • @RobinsTharakan it is running but the status is getting as failed. Because of that query not executing that is why nothing getting updated!!Updated with the screen shot, please take a look!! – Santhucool Jan 15 '15 at 11:40
  • Could you give some output from the PostgreSQL-server-logs + pgAgent-logs / windows-event-log (if in windows)? Its quite possible that this is a permissions issue and any kind of log should help in confirming that, if so. – Robins Tharakan Jan 15 '15 at 13:02
  • @RobinsTharakan could not getting connection to database that is what I am getting while executing job!! I think I may need to change some conf files, can you tell me where?? Please help buddy – Santhucool Jan 15 '15 at 13:03
  • It'd take some work, but the following two URLs may guide you in this: http://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html http://get.enterprisedb.com/docs/Tutorial_All_PP_pgAgent.pdf – Robins Tharakan Jan 15 '15 at 13:07
  • @RobinsTharakan I am new to this. Can you tell what exactly I need to change in that conf file?? – Santhucool Jan 15 '15 at 13:12
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68879/discussion-between-santhucool-and-robins-tharakan). – Santhucool Jan 15 '15 at 13:13

1 Answers1

1

I have also faced the same problem exactly. By trial and error, I changed the Connection Type from Local to Remote and gave the following connection string

user=some_user password=some_password host=localhost port=5432 dbname=some_database

in the properties of the Step. And, it worked. So, the trick is to treat even the local server as a remote server.

Adam
  • 5,403
  • 6
  • 31
  • 38
vpkannan
  • 11
  • 2