MAK
MAK

Reputation: 7260

pgAdmin: Jobs option is invisible

I am using PostgreSQL version 9.3 for Operating system window 7.

I am getting problem to display the option jobs in postgresql PgAdmin III.

Here are the pictures what I have tried:

enter image description here

After setting pgAgent Jobs checked I restart the server and services and then:

enter image description here

What is the problem?

Upvotes: 3

Views: 9664

Answers (3)

tinkal patel
tinkal patel

Reputation: 11

Seems like you have total 9 database in PostgreSQL 9.3. From 9 there is only one which is Maintenance DB. so you have to create new server by right clicking on server and in that you have to put Maintenance DB as that db in which you have executed pgAgent.sql file.

After that just start that server and you will get job node.

Hope this will help :)

Upvotes: 1

Khasan 24-7
Khasan 24-7

Reputation: 467

I have found an answer from one forum and below what should be done:

According to the code, the "pgAgent Jobs" node is displayed if the option is checked in the options dialog and if there is a table pga_job in the schema pgagent of the maintenance database. Moreover, the user used for the connection must have the USAGE privilege on the pgagent schema.

Source of the quote

I have added new schema to maintenance db and in the schema, added pga_job table without any column and Jobs node became visible, but now an error came up:

ERROR:  relation "pgagent.pga_jobclass" does not exist
LINE 1: ...s AS joblastresult   FROM pgagent.pga_job j JOIN  pgagent.pg...

This error came up because creating schema does not solve the problem fully. After that, I have created 4 tables in the pgagent schema: 1.

CREATE TABLE pgagent.pga_job
(
  jclid integer NOT NULL,
  jobjclid integer NOT NULL,
  jobagentid integer NOT NULL,
  jlgstatus integer NOT NULL,
  jobid integer NOT NULL,
  jobname character varying(255) NOT NULL
)
WITH (
  OIDS=FALSE
);
ALTER TABLE pgagent.pga_job
  OWNER TO postgres;

2.

CREATE TABLE pgagent.pga_jobagent
(
  jagpid integer NOT NULL,
  jlgstatus integer NOT NULL
)
WITH (
OIDS=FALSE
);
ALTER TABLE pgagent.pga_jobagent
  OWNER TO postgres;

3.

CREATE TABLE pgagent.pga_jobclass
(
  jclid integer NOT NULL,
  jlgstatus integer NOT NULL
)
WITH (
OIDS=FALSE
);
ALTER TABLE pgagent.pga_jobclass
  OWNER TO postgres;

4.

CREATE TABLE pgagent.pga_joblog
(
  joblogid integer NOT NULL,
  jlgstatus integer NOT NULL,
  jlgjobid integer NOT NULL,
  jlgid integer NOT NULL
)
WITH (
OIDS=FALSE
);
ALTER TABLE pgagent.pga_joblog
  OWNER TO postgres;

And the problem solved.

Upvotes: 0

Eugene
Eugene

Reputation: 2701

Found solution that works on pgAdmin 1.20.0~beta2-1 (Debian Jessie 8.1).

For Jobs node to show, you need to create new server connection with 2 mandatory parameter values:

  • Username : postgres
  • Maintenance DB : postgres

enter image description here

Upvotes: 3

Related Questions