/[pgmemcache]/trunk/pgmemcache.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/pgmemcache.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7 - (hide annotations)
Thu Jul 20 11:33:56 2006 UTC (16 years, 6 months ago) by dpavlin
File size: 7262 byte(s)
fix path to functions to include $libdir
1 dpavlin 6 -- Copyright (c) 2004 Sean Chittenden <sean@chittenden.org>
2     --
3     -- Permission is hereby granted, free of charge, to any person
4     -- obtaining a copy of this software and associated documentation
5     -- files (the "Software"), to deal in the Software without
6     -- restriction, including without limitation the rights to use, copy,
7     -- modify, merge, publish, distribute, sublicense, and/or sell copies
8     -- of the Software, and to permit persons to whom the Software is
9     -- furnished to do so, subject to the following conditions:
10     --
11     -- The above copyright notice and this permission notice shall be
12     -- included in all copies or substantial portions of the Software.
13     --
14     -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15     -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16     -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17     -- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18     -- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19     -- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20     -- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21     -- SOFTWARE.
22     --
23     -- http://people.FreeBSD.org/~seanc/pgmemcache/
24     --
25     -- $PostgreSQL: pgmemcache/pgmemcache.sql.in,v 1.5 2004/12/25 03:00:16 seanc Exp $
26    
27     -- Adjust this setting to control where the objects get created.
28     SET search_path = public;
29    
30     CREATE OR REPLACE FUNCTION memcache_init() RETURNS BOOL
31 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_init' LANGUAGE 'C';
32 dpavlin 6
33    
34     -- $1 = server name - TEXT
35     -- $2 = port number - TEXT
36     CREATE OR REPLACE FUNCTION memcache_server_add(TEXT, TEXT) RETURNS BOOL
37 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_server_add' LANGUAGE 'C' STRICT;
38 dpavlin 6
39     -- $1 = key to look up server with - TEXT
40     CREATE OR REPLACE FUNCTION memcache_server_find(TEXT) RETURNS TEXT
41 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_server_find' LANGUAGE 'C' STRICT;
42 dpavlin 6
43     -- $1 = hash value to look up server with - INT4
44     CREATE OR REPLACE FUNCTION memcache_server_find(INT4) RETURNS TEXT
45 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_server_find_hash' LANGUAGE 'C' STRICT;
46 dpavlin 6
47    
48     -- $1 = key - TEXT
49     -- $2 = val - TEXT (opt)
50     -- $3 = expire - INTERVAL (opt)
51     -- $4 = flags - INT4 (opt)
52     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT, INTERVAL, INT4) RETURNS BOOL
53 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_add' LANGUAGE 'C';
54 dpavlin 6
55     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT, INTERVAL) RETURNS BOOL
56 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_add' LANGUAGE 'C';
57 dpavlin 6
58     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT) RETURNS BOOL
59 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_add' LANGUAGE 'C';
60 dpavlin 6
61     CREATE OR REPLACE FUNCTION memcache_add(TEXT) RETURNS BOOL
62 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_add' LANGUAGE 'C';
63 dpavlin 6
64    
65     -- $1 = key - TEXT
66     -- $2 = val - TEXT (opt)
67     -- $3 = expire - INTERVAL (opt)
68     -- $4 = flags - INT4 (opt)
69     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT, TIMESTAMP WITH TIME ZONE, INT4) RETURNS BOOL
70 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_add_absexpire' LANGUAGE 'C';
71 dpavlin 6
72     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT, TIMESTAMP WITH TIME ZONE) RETURNS BOOL
73 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_add_absexpire' LANGUAGE 'C';
74 dpavlin 6
75    
76     -- $1 = key - TEXT
77     CREATE OR REPLACE FUNCTION memcache_get(TEXT) RETURNS TEXT
78 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_get' LANGUAGE 'C' STRICT;
79 dpavlin 6
80    
81     -- $1 = key - TEXT
82     -- $2 = decrement - INT4, default 1 (opt)
83     CREATE OR REPLACE FUNCTION memcache_decr(TEXT, INT4) RETURNS INT4
84 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_decr' LANGUAGE 'C';
85 dpavlin 6
86     CREATE OR REPLACE FUNCTION memcache_decr(TEXT) RETURNS INT4
87 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_decr' LANGUAGE 'C';
88 dpavlin 6
89    
90     -- $1 = key - TEXT
91     -- $2 = increment - INT4, default 1 (opt)
92     CREATE OR REPLACE FUNCTION memcache_incr(TEXT, INT4) RETURNS INT4
93 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_incr' LANGUAGE 'C';
94 dpavlin 6
95     CREATE OR REPLACE FUNCTION memcache_incr(TEXT) RETURNS INT4
96 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_incr' LANGUAGE 'C';
97 dpavlin 6
98    
99     -- $1 = key - TEXT
100     -- $2 = hold timer - INTERVAL (opt)
101     CREATE OR REPLACE FUNCTION memcache_delete(TEXT, INTERVAL) RETURNS BOOL
102 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_delete' LANGUAGE 'C';
103 dpavlin 6
104     CREATE OR REPLACE FUNCTION memcache_delete(TEXT) RETURNS BOOL
105 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_delete' LANGUAGE 'C';
106 dpavlin 6
107     -- Flush all servers in the cluster
108     CREATE OR REPLACE FUNCTION memcache_flush_all() RETURNS BOOL
109 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_flush_all0' LANGUAGE 'C';
110 dpavlin 6
111     -- $1 = key to server to be flushed
112     CREATE OR REPLACE FUNCTION memcache_flush(TEXT) RETURNS BOOL
113 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_flush' LANGUAGE 'C';
114 dpavlin 6
115     -- Cleans up the backend
116     CREATE OR REPLACE FUNCTION memcache_free() RETURNS BOOL
117 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_free' LANGUAGE 'C';
118 dpavlin 6
119     CREATE OR REPLACE FUNCTION memcache_hash(TEXT) RETURNS INT4
120 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_hash' LANGUAGE 'C';
121 dpavlin 6
122    
123     -- $1 = key - TEXT
124     -- $2 = val - TEXT (opt)
125     -- $3 = expire - INTERVAL (opt)
126     -- $4 = flags - INT4 (opt)
127     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT, INTERVAL, INT4) RETURNS BOOL
128 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_replace' LANGUAGE 'C';
129 dpavlin 6
130     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT, INTERVAL) RETURNS BOOL
131 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_replace' LANGUAGE 'C';
132 dpavlin 6
133     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT) RETURNS BOOL
134 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_replace' LANGUAGE 'C';
135 dpavlin 6
136     CREATE OR REPLACE FUNCTION memcache_replace(TEXT) RETURNS BOOL
137 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_replace' LANGUAGE 'C';
138 dpavlin 6
139    
140     -- $1 = key - TEXT
141     -- $2 = val - TEXT (opt)
142     -- $3 = expire - INTERVAL (opt)
143     -- $4 = flags - INT4 (opt)
144     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT, TIMESTAMP WITH TIME ZONE, INT4) RETURNS BOOL
145 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_replace_absexpire' LANGUAGE 'C';
146 dpavlin 6
147     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT, TIMESTAMP WITH TIME ZONE) RETURNS BOOL
148 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_replace_absexpire' LANGUAGE 'C';
149 dpavlin 6
150    
151     -- $1 = key - TEXT
152     -- $2 = val - TEXT (opt)
153     -- $3 = expire - INTERVAL (opt)
154     -- $4 = flags - INT4 (opt)
155     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT, INTERVAL, INT4) RETURNS BOOL
156 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_set' LANGUAGE 'C';
157 dpavlin 6
158     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT, INTERVAL) RETURNS BOOL
159 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_set' LANGUAGE 'C';
160 dpavlin 6
161     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT) RETURNS BOOL
162 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_set' LANGUAGE 'C';
163 dpavlin 6
164     CREATE OR REPLACE FUNCTION memcache_set(TEXT) RETURNS BOOL
165 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_set' LANGUAGE 'C';
166 dpavlin 6
167    
168     -- $1 = key - TEXT
169     -- $2 = val - TEXT (opt)
170     -- $3 = expire - INTERVAL (opt)
171     -- $4 = flags - INT4 (opt)
172     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT, TIMESTAMP WITH TIME ZONE, INT4) RETURNS BOOL
173 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_set_absexpire' LANGUAGE 'C';
174 dpavlin 6
175     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT, TIMESTAMP WITH TIME ZONE) RETURNS BOOL
176 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_set_absexpire' LANGUAGE 'C';
177 dpavlin 6
178    
179     CREATE OR REPLACE FUNCTION memcache_stats() RETURNS TEXT
180 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_stats' LANGUAGE 'C';
181 dpavlin 6
182     -- $1 = stat name - TEXT
183     CREATE OR REPLACE FUNCTION memcache_stats(TEXT) RETURNS TEXT
184 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_stat' LANGUAGE 'C';
185 dpavlin 6
186    
187     -- DEPRECIATED!!! Use memcache_flush(TEXT) instead!!!
188     -- $1 = key to server to be flushed
189     CREATE OR REPLACE FUNCTION memcache_flush_all(TEXT) RETURNS BOOL
190 dpavlin 7 AS '$libdir/pgmemcache', 'memcache_flush_all' LANGUAGE 'C';

  ViewVC Help
Powered by ViewVC 1.1.26