Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e8ee17

Browse files
committed
Merge commit 'b2297d5938ad0fb19212b48bb0f42f0b6dfebd2a' into PGPROEE9_6_scheduler
Conflicts:contrib/pgpro_scheduler/src/cron_string.hcontrib/pgpro_scheduler/src/scheduler_job.h
2 parents4b9ce65 +b2297d5 commit8e8ee17

File tree

5 files changed

+12
-64
lines changed

5 files changed

+12
-64
lines changed

‎contrib/pgpro_scheduler/pgpro_scheduler--1.0.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,6 @@ CREATE FUNCTION schedule.cron2jsontext(CSTRING)
10561056
AS'MODULE_PATHNAME','cron_string_to_json_text'
10571057
LANGUAGE C IMMUTABLE;
10581058

1059-
CREATEFUNCTIONtemp_now(timestamp with time zone)
1060-
RETURNStimestamp with time zone
1061-
AS'MODULE_PATHNAME','temp_now'
1062-
LANGUAGE C IMMUTABLE;
1063-
10641059
--------------
10651060
-- TRIGGERS --
10661061
--------------

‎contrib/pgpro_scheduler/src/cron_string.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include<stdarg.h>
55
#include"cron_string.h"
66
#include"postgres.h"
7+
#include"c.h"
78
#include"port.h"
89

910

‎contrib/pgpro_scheduler/src/cron_string.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include<stdlib.h>
66
#include<string.h>
77
#include<stdarg.h>
8+
#include"postgres.h"
9+
#include"port.h"
810

911
externintcps_error;
1012

@@ -41,11 +43,7 @@ typedef struct {
4143
}cron_ent_t;
4244

4345
voiddestroyCronEnt(cron_ent_t*);
44-
void_cps_set_error(intnum,constchar*message, ...)
45-
#ifdef__GNUC__
46-
__attribute__ ((format (gnu_printf,2,3)))
47-
#endif
48-
;;
46+
void_cps_set_error(intnum,constchar*message, ...)pg_attribute_printf(2,3);
4947
char*get_cps_error(void);
5048
int_cps_string_has(char*str,charc);
5149
char*_cps_append_string(char*str,char*to_add);

‎contrib/pgpro_scheduler/src/pgpro_scheduler.c

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@
1414
#include"pg_config.h"
1515
#include"fmgr.h"
1616
#include"pgstat.h"
17-
#include"utils/builtins.h"
1817
#include"executor/spi.h"
1918
#include"tcop/utility.h"
2019
#include"lib/stringinfo.h"
20+
#include"catalog/pg_type.h"
2121
#include"access/xact.h"
2222
#include"utils/snapmgr.h"
2323
#include"utils/datetime.h"
24+
#include"utils/builtins.h"
2425
#include"catalog/pg_db_role_setting.h"
2526
#include"commands/dbcommands.h"
2627

28+
2729
#include"char_array.h"
2830
#include"sched_manager_poll.h"
2931
#include"cron_string.h"
@@ -280,6 +282,7 @@ void parent_scheduler_main(Datum arg)
280282
boolrefresh= false;
281283

282284
init_worker_mem_ctx("Parent scheduler context");
285+
elog(LOG,"Start PostgresPro scheduler.");
283286

284287
/*CurrentResourceOwner = ResourceOwnerCreate(NULL, "pgpro_scheduler");*/
285288
SetConfigOption("application_name","pgp-s supervisor",PGC_USERSET,PGC_S_SESSION);
@@ -381,8 +384,6 @@ pg_scheduler_startup(void)
381384
{
382385
BackgroundWorkerworker;
383386

384-
elog(LOG,"Start PostgresPro scheduler.");
385-
386387
worker.bgw_flags=BGWORKER_SHMEM_ACCESS |
387388
BGWORKER_BACKEND_DATABASE_CONNECTION;
388389
worker.bgw_start_time=BgWorkerStart_ConsistentState;
@@ -483,52 +484,6 @@ void _PG_init(void)
483484
pg_scheduler_startup();
484485
}
485486

486-
PG_FUNCTION_INFO_V1(temp_now);
487-
Datum
488-
temp_now(PG_FUNCTION_ARGS)
489-
{
490-
TimestampTzts;
491-
structpg_tminfo;
492-
structpg_tmcp;
493-
inttz;
494-
fsec_tfsec;
495-
constchar*tzn;
496-
longinttoff=0;
497-
498-
if(!PG_ARGISNULL(0))
499-
{
500-
ts=PG_GETARG_TIMESTAMPTZ(0);
501-
}
502-
else
503-
{
504-
ts=GetCurrentTimestamp();
505-
}
506-
507-
timestamp2tm(ts,&tz,&info,&fsec,&tzn,session_timezone );
508-
info.tm_wday=j2day(date2j(info.tm_year,info.tm_mon,info.tm_mday));
509-
510-
/*elog(NOTICE, "WDAY: %d, MON: %d, MDAY: %d, HOUR: %d, MIN: %d, YEAR: %d (%ld)",
511-
info.tm_wday, info.tm_mon, info.tm_mday, info.tm_hour, info.tm_min,
512-
info.tm_year, info.tm_gmtoff);
513-
elog(NOTICE, "TZP: %d, ZONE: %s", tz, tzn); */
514-
515-
cp.tm_mon=info.tm_mon;
516-
cp.tm_mday=info.tm_mday;
517-
cp.tm_hour=info.tm_hour;
518-
cp.tm_min=info.tm_min;
519-
cp.tm_year=info.tm_year;
520-
cp.tm_sec=info.tm_sec;
521-
522-
toff=DetermineTimeZoneOffset(&cp,session_timezone);
523-
/*elog(NOTICE, "Detect: offset = %ld", toff); */
524-
525-
cp.tm_gmtoff=-toff;
526-
tm2timestamp(&cp,0,&tz,&ts);
527-
528-
529-
PG_RETURN_TIMESTAMPTZ(ts);
530-
}
531-
532487
PG_FUNCTION_INFO_V1(cron_string_to_json_text);
533488
Datum
534489
cron_string_to_json_text(PG_FUNCTION_ARGS)
@@ -567,6 +522,7 @@ cron_string_to_json_text(PG_FUNCTION_ARGS)
567522
elog(ERROR,"unknown error: %d",cps_error);
568523
}
569524
}
525+
PG_RETURN_NULL();
570526
}
571527

572528

‎contrib/pgpro_scheduler/src/scheduler_job.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include<stdarg.h>
88
#include"utils/timestamp.h"
99
#include"memutils.h"
10+
#include"c.h"
11+
#include"port.h"
1012

1113
typedefstruct {
1214
intcron_id;
@@ -30,11 +32,7 @@ typedef struct {
3032
job_t*init_scheduler_job(job_t*j);
3133
job_t*get_expired_jobs(char*nodename,int*n,int*is_error);
3234
job_t*get_jobs_to_do(char*nodename,int*n,int*is_error);
33-
job_t*set_job_error(job_t*j,constchar*fmt, ...)
34-
#ifdef__GNUC__
35-
__attribute__ ((format (gnu_printf,2,3)));
36-
#endif
37-
;
35+
job_t*set_job_error(job_t*j,constchar*fmt, ...)pg_attribute_printf(2,3);
3836
intmove_job_to_log(job_t*j,boolstatus);
3937
voiddestroy_job(job_t*j,intselfdestroy);
4038

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp