forked from orafce/orafce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorafce.c
57 lines (46 loc) · 1.18 KB
/
orafce.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "postgres.h"
#include "storage/lwlock.h"
#include "storage/shmem.h"
#include "utils/guc.h"
#include "commands/variable.h"
#include "orafce.h"
#include "builtins.h"
#include "pipe.h"
/* default value */
char *nls_date_format = NULL;
char *orafce_timezone = NULL;
void
_PG_init(void)
{
#if PG_VERSION_NUM < 90600
RequestAddinLWLocks(1);
#endif
RequestAddinShmemSpace(SHMEMMSGSZ);
/* Define custom GUC variables. */
DefineCustomStringVariable("orafce.nls_date_format",
"Emulate oracle's date output behaviour.",
NULL,
&nls_date_format,
NULL,
PGC_USERSET,
0,
NULL,
NULL, NULL);
DefineCustomStringVariable("orafce.timezone",
"Specify timezone used for sysdate function.",
NULL,
&orafce_timezone,
"GMT",
PGC_USERSET,
0,
check_timezone, NULL, show_timezone);
DefineCustomBoolVariable("orafce.varchar2_null_safe_concat",
"Specify timezone used for sysdate function.",
NULL,
&orafce_varchar2_null_safe_concat,
false,
PGC_USERSET,
0,
NULL, NULL, NULL);
EmitWarningsOnPlaceholders("orafce");
}