-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
82 lines (66 loc) · 1.62 KB
/
README
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Note: flex 2.5.33 or greater is required (need support for %option noyyalloc noyyfree noyyrealloc)
To build:
make
make install # Note: You might have to be a privileged user to do this
(Note: set DONT_USE_PGXS before calling make if you don't want to use pgxs for
the build. If you don't know what this means, you should probably just ignore
it.)
-- restart postgresql
DROP FUNCTION PL_LOLCODE_CALL_HANDLER() CASCADE;
-- For 8.2:
INSERT INTO pg_pltemplate (
tmplname,
tmpltrusted,
tmplhandler,
tmpllibrary
)
VALUES (
'pllolcode',
't',
'pl_lolcode_call_handler',
'$libdir/pllolcode'
);
-- For 8.3:
INSERT INTO pg_pltemplate (
tmplname,
tmpltrusted,
tmpldbacreate,
tmplhandler,
tmpllibrary
)
VALUES (
'pllolcode',
't',
't',
'pl_lolcode_call_handler',
'$libdir/pllolcode'
);
CREATE LANGUAGE PLLOLCODE;
-- Sample function:
CREATE FUNCTION LOL_MAIN_TEST(TEXT)
RETURNS BOOLEAN
LANGUAGE PLLOLCODE
AS $$
HAI
VISIBLE INFO LOL1
FOUND YR WIN
KTHXBYE
$$;
SELECT LOL_MAIN_TEST('IM IN YR DATABUKKIT');
/*
INFO: IM IN YR DATABUKKIT
lol_main_test
---------------
t
(1 row)
*/
Notes:
- PL/LOLCODE aims to implement the LOLCODE 1.2 spec, at least at the time of
this writing
- Note as in the sample function above, boolean values (TROOF values, in
LOLCODE parlance) are WIN (true) and FAIL (false)
- Arguments passed to a function are available with the special PL/LOLCODE
variables LOL1, LOL2, etc.
- The VISIBLE command corresponds to RAISE in pl/pgsql. It can optionally take
values of INFO, NOTICE, etc. (just like RAISE) to indicate the desired log
level.