forked from plv8/plv8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plv8.sql.common
52 lines (40 loc) · 1.19 KB
/
plv8.sql.common
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
#include "pg_config.h"
#if PG_VERSION_NUM < 90100
-- adjust this setting to control where the objects get created.
SET search_path = public;
BEGIN;
#endif
CREATE FUNCTION plv8_call_handler() RETURNS language_handler
AS 'MODULE_PATHNAME' LANGUAGE C;
#if PG_VERSION_NUM >= 90000
CREATE FUNCTION plv8_inline_handler(internal) RETURNS void
AS 'MODULE_PATHNAME' LANGUAGE C;
#endif
CREATE FUNCTION plv8_call_validator(oid) RETURNS void
AS 'MODULE_PATHNAME' LANGUAGE C;
CREATE TRUSTED LANGUAGE @LANG_NAME@
HANDLER plv8_call_handler
#if PG_VERSION_NUM >= 90000
INLINE plv8_inline_handler
#endif
VALIDATOR plv8_call_validator;
#ifdef LANG_plv8
CREATE DOMAIN plv8_int2array AS int2[];
CREATE DOMAIN plv8_int4array AS int4[];
CREATE DOMAIN plv8_float4array AS float4[];
CREATE DOMAIN plv8_float8array AS float8[];
CREATE DOMAIN plv8_int8array AS int8[];
CREATE OR REPLACE FUNCTION plv8_version ( )
RETURNS TEXT AS
$$
return "@PLV8_VERSION@";
$$ LANGUAGE plv8;
CREATE FUNCTION plv8_reset() RETURNS void
AS 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION plv8_info() RETURNS JSON
AS 'MODULE_PATHNAME' LANGUAGE C;
REVOKE ALL ON FUNCTION plv8_info() FROM PUBLIC;
#endif
#if PG_VERSION_NUM < 90100
COMMIT;
#endif