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

Commitb2297d5

Browse files
author
Vladimir Ershov
committed
reduce output
1 parentbf7c98f commitb2297d5

File tree

3 files changed

+5
-57
lines changed

3 files changed

+5
-57
lines changed

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ OBJS = src/pgpro_scheduler.o src/cron_string.o src/sched_manager_poll.o \
77
EXTENSION = pgpro_scheduler
88
DATA = pgpro_scheduler--1.0.sql
99
REGRESS= install_pgpro_scheduler cron_string
10-
REGRESS_OPTS = --user=postgres
10+
#REGRESS_OPTS = --user=postgres
1111
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
1212

1313
ifdefUSE_PGXS

‎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
--------------

‎src/pgpro_scheduler.c‎

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include"postgres.h"
2+
#include"port.h"
23

34
#include"miscadmin.h"
45
#include"postmaster/bgworker.h"
@@ -11,20 +12,19 @@
1112
#include"storage/shm_toc.h"
1213

1314
#include"pg_config.h"
14-
#include"pgtime.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

27-
#include"port.h"
2828

2929
#include"char_array.h"
3030
#include"sched_manager_poll.h"
@@ -282,6 +282,7 @@ void parent_scheduler_main(Datum arg)
282282
boolrefresh= false;
283283

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

286287
/*CurrentResourceOwner = ResourceOwnerCreate(NULL, "pgpro_scheduler");*/
287288
SetConfigOption("application_name","pgp-s supervisor",PGC_USERSET,PGC_S_SESSION);
@@ -383,8 +384,6 @@ pg_scheduler_startup(void)
383384
{
384385
BackgroundWorkerworker;
385386

386-
elog(LOG,"Start PostgresPro scheduler.");
387-
388387
worker.bgw_flags=BGWORKER_SHMEM_ACCESS |
389388
BGWORKER_BACKEND_DATABASE_CONNECTION;
390389
worker.bgw_start_time=BgWorkerStart_ConsistentState;
@@ -485,52 +484,6 @@ void _PG_init(void)
485484
pg_scheduler_startup();
486485
}
487486

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-
534487
PG_FUNCTION_INFO_V1(cron_string_to_json_text);
535488
Datum
536489
cron_string_to_json_text(PG_FUNCTION_ARGS)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp