|
1 | 1 | #include"postgres.h" |
| 2 | +#include"port.h" |
2 | 3 |
|
3 | 4 | #include"miscadmin.h" |
4 | 5 | #include"postmaster/bgworker.h" |
|
11 | 12 | #include"storage/shm_toc.h" |
12 | 13 |
|
13 | 14 | #include"pg_config.h" |
14 | | -#include"pgtime.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 |
|
27 | | -#include"port.h" |
28 | 28 |
|
29 | 29 | #include"char_array.h" |
30 | 30 | #include"sched_manager_poll.h" |
@@ -282,6 +282,7 @@ void parent_scheduler_main(Datum arg) |
282 | 282 | boolrefresh= false; |
283 | 283 |
|
284 | 284 | init_worker_mem_ctx("Parent scheduler context"); |
| 285 | +elog(LOG,"Start PostgresPro scheduler."); |
285 | 286 |
|
286 | 287 | /*CurrentResourceOwner = ResourceOwnerCreate(NULL, "pgpro_scheduler");*/ |
287 | 288 | SetConfigOption("application_name","pgp-s supervisor",PGC_USERSET,PGC_S_SESSION); |
@@ -383,8 +384,6 @@ pg_scheduler_startup(void) |
383 | 384 | { |
384 | 385 | BackgroundWorkerworker; |
385 | 386 |
|
386 | | -elog(LOG,"Start PostgresPro scheduler."); |
387 | | - |
388 | 387 | worker.bgw_flags=BGWORKER_SHMEM_ACCESS | |
389 | 388 | BGWORKER_BACKEND_DATABASE_CONNECTION; |
390 | 389 | worker.bgw_start_time=BgWorkerStart_ConsistentState; |
@@ -485,52 +484,6 @@ void _PG_init(void) |
485 | 484 | pg_scheduler_startup(); |
486 | 485 | } |
487 | 486 |
|
488 | | -PG_FUNCTION_INFO_V1(temp_now); |
489 | | -Datum |
490 | | -temp_now(PG_FUNCTION_ARGS) |
491 | | -{ |
492 | | -TimestampTzts; |
493 | | -structpg_tminfo; |
494 | | -structpg_tmcp; |
495 | | -inttz; |
496 | | -fsec_tfsec; |
497 | | -constchar*tzn; |
498 | | -longinttoff=0; |
499 | | - |
500 | | -if(!PG_ARGISNULL(0)) |
501 | | -{ |
502 | | -ts=PG_GETARG_TIMESTAMPTZ(0); |
503 | | -} |
504 | | -else |
505 | | -{ |
506 | | -ts=GetCurrentTimestamp(); |
507 | | -} |
508 | | - |
509 | | -timestamp2tm(ts,&tz,&info,&fsec,&tzn,session_timezone ); |
510 | | -info.tm_wday=j2day(date2j(info.tm_year,info.tm_mon,info.tm_mday)); |
511 | | - |
512 | | -/*elog(NOTICE, "WDAY: %d, MON: %d, MDAY: %d, HOUR: %d, MIN: %d, YEAR: %d (%ld)", |
513 | | -info.tm_wday, info.tm_mon, info.tm_mday, info.tm_hour, info.tm_min, |
514 | | -info.tm_year, info.tm_gmtoff); |
515 | | -elog(NOTICE, "TZP: %d, ZONE: %s", tz, tzn); */ |
516 | | - |
517 | | -cp.tm_mon=info.tm_mon; |
518 | | -cp.tm_mday=info.tm_mday; |
519 | | -cp.tm_hour=info.tm_hour; |
520 | | -cp.tm_min=info.tm_min; |
521 | | -cp.tm_year=info.tm_year; |
522 | | -cp.tm_sec=info.tm_sec; |
523 | | - |
524 | | -toff=DetermineTimeZoneOffset(&cp,session_timezone); |
525 | | -/*elog(NOTICE, "Detect: offset = %ld", toff); */ |
526 | | - |
527 | | -cp.tm_gmtoff=-toff; |
528 | | -tm2timestamp(&cp,0,&tz,&ts); |
529 | | - |
530 | | - |
531 | | -PG_RETURN_TIMESTAMPTZ(ts); |
532 | | -} |
533 | | - |
534 | 487 | PG_FUNCTION_INFO_V1(cron_string_to_json_text); |
535 | 488 | Datum |
536 | 489 | cron_string_to_json_text(PG_FUNCTION_ARGS) |
|