Skip to content

Commit 3ef0582

Browse files
author
Vladimir Ershov
committed
job_id TYPE int => bigint
1 parent b4d0e53 commit 3ef0582

10 files changed

+1566
-39
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ OBJS = src/pgpro_scheduler.o src/cron_string.o src/sched_manager_poll.o \
55
src/scheduler_executor.o \
66
$(WIN32RES)
77
EXTENSION = pgpro_scheduler
8-
DATA = pgpro_scheduler--2.0.sql
8+
DATA = pgpro_scheduler--2.0.sql pgpro_scheduler--2.0--2.1.sql \
9+
pgpro_scheduler--2.1.sql
910
REGRESS = install_pgpro_scheduler cron_string
1011
#REGRESS_OPTS = --user=postgres
1112
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add

pgpro_scheduler--2.0--2.1.sql

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
SET search_path TO schedule;
2+
3+
DROP VIEW job_status;
4+
DROP VIEW all_job_status;
5+
6+
ALTER TABLE at_jobs_submitted ALTER id TYPE bigint;
7+
ALTER TABLE at_jobs_process ALTER id TYPE bigint;
8+
ALTER TABLE at_jobs_done ALTER id TYPE bigint;
9+
10+
CREATE VIEW job_status AS
11+
SELECT
12+
id, node, name, comments, at as run_after,
13+
do_sql as query, params, depends_on, executor as run_as, attempt,
14+
resubmit_limit, postpone as max_wait_interval,
15+
max_run_time as max_duration, submit_time, canceled,
16+
start_time, status as is_success, reason as error, done_time,
17+
'done'::job_at_status_t status
18+
FROM schedule.at_jobs_done where owner = session_user
19+
UNION
20+
SELECT
21+
id, node, name, comments, at as run_after,
22+
do_sql as query, params, depends_on, executor as run_as, attempt,
23+
resubmit_limit, postpone as max_wait_interval,
24+
max_run_time as max_duration, submit_time, canceled, start_time,
25+
NULL as is_success, NULL as error, NULL as done_time,
26+
'processing'::job_at_status_t status
27+
FROM ONLY schedule.at_jobs_process where owner = session_user
28+
UNION
29+
SELECT
30+
id, node, name, comments, at as run_after,
31+
do_sql as query, params, depends_on, executor as run_as, attempt,
32+
resubmit_limit, postpone as max_wait_interval,
33+
max_run_time as max_duration, submit_time, canceled,
34+
NULL as start_time, NULL as is_success, NULL as error,
35+
NULL as done_time,
36+
'submitted'::job_at_status_t status
37+
FROM ONLY schedule.at_jobs_submitted where owner = session_user;
38+
39+
CREATE VIEW all_job_status AS
40+
SELECT
41+
id, node, name, comments, at as run_after,
42+
do_sql as query, params, depends_on, executor as run_as, owner,
43+
attempt, resubmit_limit, postpone as max_wait_interval,
44+
max_run_time as max_duration, submit_time, canceled,
45+
start_time, status as is_success, reason as error, done_time,
46+
'done'::job_at_status_t status
47+
FROM schedule.at_jobs_done
48+
UNION
49+
SELECT
50+
id, node, name, comments, at as run_after,
51+
do_sql as query, params, depends_on, executor as run_as, owner,
52+
attempt, resubmit_limit, postpone as max_wait_interval,
53+
max_run_time as max_duration, submit_time, canceled, start_time,
54+
NULL as is_success, NULL as error, NULL as done_time,
55+
'processing'::job_at_status_t status
56+
FROM ONLY schedule.at_jobs_process
57+
UNION
58+
SELECT
59+
id, node, name, comments, at as run_after,
60+
do_sql as query, params, depends_on, executor as run_as, owner,
61+
attempt, resubmit_limit, postpone as max_wait_interval,
62+
max_run_time as max_duration, submit_time, canceled,
63+
NULL as start_time, NULL as is_success, NULL as error,
64+
NULL as done_time,
65+
'submitted'::job_at_status_t status
66+
FROM ONLY schedule.at_jobs_submitted;
67+
68+
GRANT SELECT ON schedule.job_status TO public;
69+
70+
RESET search_path;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy