Skip to content

Commit 449fc80

Browse files
author
Vladimir Ershov
committed
Merge branch 'master' into usability_fix
2 parents 31ea678 + b2297d5 commit 449fc80

File tree

3 files changed

+5
-55
lines changed

3 files changed

+5
-55
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
ifdef USE_PGXS

pgpro_scheduler--1.0.sql

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

1099-
CREATE FUNCTION temp_now(timestamp with time zone)
1100-
RETURNS timestamp with time zone
1101-
AS 'MODULE_PATHNAME', 'temp_now'
1102-
LANGUAGE C IMMUTABLE;
1103-
11041099
--------------
11051100
-- TRIGGERS --
11061101
--------------

src/pgpro_scheduler.c

Lines changed: 4 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
bool refresh = 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
BackgroundWorker worker;
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-
TimestampTz ts;
491-
struct pg_tm info;
492-
struct pg_tm cp;
493-
int tz;
494-
fsec_t fsec;
495-
const char *tzn;
496-
long int toff = 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)

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