2 -- check static and global data (SD and GD)
4 CREATE FUNCTION global_test_one() returns text
6 'if "global_test" not in SD:
7 SD["global_test"] = "set by global_test_one"
8 if "global_test" not in GD:
9 GD["global_test"] = "set by global_test_one"
10 return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]'
12 CREATE FUNCTION global_test_two() returns text
14 'if "global_test" not in SD:
15 SD["global_test"] = "set by global_test_two"
16 if "global_test" not in GD:
17 GD["global_test"] = "set by global_test_two"
18 return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]'
20 CREATE FUNCTION static_test() returns int4
23 SD["call"] = SD["call"] + 1
41 SELECT global_test_one();
43 --------------------------------------------------------
44 SD: set by global_test_one, GD: set by global_test_one
47 SELECT global_test_two();
49 --------------------------------------------------------
50 SD: set by global_test_two, GD: set by global_test_one