-
Notifications
You must be signed in to change notification settings - Fork 0
/
yeneid--1.0.sql
44 lines (29 loc) · 1010 Bytes
/
yeneid--1.0.sql
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
/* yeneid/yeneid--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION yeneid" to load this file. \quit
CREATE FUNCTION yeneid_handler(internal)
RETURNS table_am_handler
AS 'MODULE_PATHNAME'
LANGUAGE C;
-- Access method
CREATE ACCESS METHOD yeneid TYPE TABLE HANDLER yeneid_handler;
COMMENT ON ACCESS METHOD yeneid IS 'table AM for Yezzey';
CREATE OR REPLACE FUNCTION yeneid_define_relation_offload_policy_internal(reloid OID) RETURNS void
AS 'MODULE_PATHNAME'
VOLATILE
EXECUTE ON COORDINATOR
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION yeneid_define_relation_offload_policy_internal_seg(reloid OID) RETURNS void
AS 'MODULE_PATHNAME'
VOLATILE
EXECUTE ON ALL SEGMENTS
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION
yeneid_relation(reloid OID)
RETURNS void
AS $$
BEGIN
PERFORM yeneid_define_relation_offload_policy_internal(reloid);
PERFORM yeneid_define_relation_offload_policy_internal_seg(reloid);
END;
$$ LANGUAGE PLPGSQL;