|
14 | 14 | #include"pg_config.h"
|
15 | 15 | #include"fmgr.h"
|
16 | 16 | #include"pgstat.h"
|
17 |
| -#include"utils/builtins.h" |
18 | 17 | #include"executor/spi.h"
|
19 | 18 | #include"tcop/utility.h"
|
20 | 19 | #include"lib/stringinfo.h"
|
| 20 | +#include"catalog/pg_type.h" |
21 | 21 | #include"access/xact.h"
|
22 | 22 | #include"utils/snapmgr.h"
|
23 | 23 | #include"utils/datetime.h"
|
| 24 | +#include"utils/builtins.h" |
24 | 25 | #include"catalog/pg_db_role_setting.h"
|
25 | 26 | #include"commands/dbcommands.h"
|
26 | 27 |
|
| 28 | + |
27 | 29 | #include"char_array.h"
|
28 | 30 | #include"sched_manager_poll.h"
|
29 | 31 | #include"cron_string.h"
|
@@ -280,6 +282,7 @@ void parent_scheduler_main(Datum arg)
|
280 | 282 | boolrefresh= false;
|
281 | 283 |
|
282 | 284 | init_worker_mem_ctx("Parent scheduler context");
|
| 285 | +elog(LOG,"Start PostgresPro scheduler."); |
283 | 286 |
|
284 | 287 | /*CurrentResourceOwner = ResourceOwnerCreate(NULL, "pgpro_scheduler");*/
|
285 | 288 | SetConfigOption("application_name","pgp-s supervisor",PGC_USERSET,PGC_S_SESSION);
|
@@ -381,8 +384,6 @@ pg_scheduler_startup(void)
|
381 | 384 | {
|
382 | 385 | BackgroundWorkerworker;
|
383 | 386 |
|
384 |
| -elog(LOG,"Start PostgresPro scheduler."); |
385 |
| - |
386 | 387 | worker.bgw_flags=BGWORKER_SHMEM_ACCESS |
|
387 | 388 | BGWORKER_BACKEND_DATABASE_CONNECTION;
|
388 | 389 | worker.bgw_start_time=BgWorkerStart_ConsistentState;
|
@@ -483,52 +484,6 @@ void _PG_init(void)
|
483 | 484 | pg_scheduler_startup();
|
484 | 485 | }
|
485 | 486 |
|
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 |
| - |
532 | 487 | PG_FUNCTION_INFO_V1(cron_string_to_json_text);
|
533 | 488 | Datum
|
534 | 489 | cron_string_to_json_text(PG_FUNCTION_ARGS)
|
|