/[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 6 - (hide annotations)
Thu Jul 20 11:29:50 2006 UTC (16 years, 6 months ago) by dpavlin
File size: 6974 byte(s)
PostgreSQL 8.1 doesn't need full path to functions
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     AS 'pgmemcache', 'memcache_init' LANGUAGE 'C';
32    
33    
34     -- $1 = server name - TEXT
35     -- $2 = port number - TEXT
36     CREATE OR REPLACE FUNCTION memcache_server_add(TEXT, TEXT) RETURNS BOOL
37     AS 'pgmemcache', 'memcache_server_add' LANGUAGE 'C' STRICT;
38    
39     -- $1 = key to look up server with - TEXT
40     CREATE OR REPLACE FUNCTION memcache_server_find(TEXT) RETURNS TEXT
41     AS 'pgmemcache', 'memcache_server_find' LANGUAGE 'C' STRICT;
42    
43     -- $1 = hash value to look up server with - INT4
44     CREATE OR REPLACE FUNCTION memcache_server_find(INT4) RETURNS TEXT
45     AS 'pgmemcache', 'memcache_server_find_hash' LANGUAGE 'C' STRICT;
46    
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     AS 'pgmemcache', 'memcache_add' LANGUAGE 'C';
54    
55     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT, INTERVAL) RETURNS BOOL
56     AS 'pgmemcache', 'memcache_add' LANGUAGE 'C';
57    
58     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT) RETURNS BOOL
59     AS 'pgmemcache', 'memcache_add' LANGUAGE 'C';
60    
61     CREATE OR REPLACE FUNCTION memcache_add(TEXT) RETURNS BOOL
62     AS 'pgmemcache', 'memcache_add' LANGUAGE 'C';
63    
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     AS 'pgmemcache', 'memcache_add_absexpire' LANGUAGE 'C';
71    
72     CREATE OR REPLACE FUNCTION memcache_add(TEXT, TEXT, TIMESTAMP WITH TIME ZONE) RETURNS BOOL
73     AS 'pgmemcache', 'memcache_add_absexpire' LANGUAGE 'C';
74    
75    
76     -- $1 = key - TEXT
77     CREATE OR REPLACE FUNCTION memcache_get(TEXT) RETURNS TEXT
78     AS 'pgmemcache', 'memcache_get' LANGUAGE 'C' STRICT;
79    
80    
81     -- $1 = key - TEXT
82     -- $2 = decrement - INT4, default 1 (opt)
83     CREATE OR REPLACE FUNCTION memcache_decr(TEXT, INT4) RETURNS INT4
84     AS 'pgmemcache', 'memcache_decr' LANGUAGE 'C';
85    
86     CREATE OR REPLACE FUNCTION memcache_decr(TEXT) RETURNS INT4
87     AS 'pgmemcache', 'memcache_decr' LANGUAGE 'C';
88    
89    
90     -- $1 = key - TEXT
91     -- $2 = increment - INT4, default 1 (opt)
92     CREATE OR REPLACE FUNCTION memcache_incr(TEXT, INT4) RETURNS INT4
93     AS 'pgmemcache', 'memcache_incr' LANGUAGE 'C';
94    
95     CREATE OR REPLACE FUNCTION memcache_incr(TEXT) RETURNS INT4
96     AS 'pgmemcache', 'memcache_incr' LANGUAGE 'C';
97    
98    
99     -- $1 = key - TEXT
100     -- $2 = hold timer - INTERVAL (opt)
101     CREATE OR REPLACE FUNCTION memcache_delete(TEXT, INTERVAL) RETURNS BOOL
102     AS 'pgmemcache', 'memcache_delete' LANGUAGE 'C';
103    
104     CREATE OR REPLACE FUNCTION memcache_delete(TEXT) RETURNS BOOL
105     AS 'pgmemcache', 'memcache_delete' LANGUAGE 'C';
106    
107     -- Flush all servers in the cluster
108     CREATE OR REPLACE FUNCTION memcache_flush_all() RETURNS BOOL
109     AS 'pgmemcache', 'memcache_flush_all0' LANGUAGE 'C';
110    
111     -- $1 = key to server to be flushed
112     CREATE OR REPLACE FUNCTION memcache_flush(TEXT) RETURNS BOOL
113     AS 'pgmemcache', 'memcache_flush' LANGUAGE 'C';
114    
115     -- Cleans up the backend
116     CREATE OR REPLACE FUNCTION memcache_free() RETURNS BOOL
117     AS 'pgmemcache', 'memcache_free' LANGUAGE 'C';
118    
119     CREATE OR REPLACE FUNCTION memcache_hash(TEXT) RETURNS INT4
120     AS 'pgmemcache', 'memcache_hash' LANGUAGE 'C';
121    
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     AS 'pgmemcache', 'memcache_replace' LANGUAGE 'C';
129    
130     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT, INTERVAL) RETURNS BOOL
131     AS 'pgmemcache', 'memcache_replace' LANGUAGE 'C';
132    
133     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT) RETURNS BOOL
134     AS 'pgmemcache', 'memcache_replace' LANGUAGE 'C';
135    
136     CREATE OR REPLACE FUNCTION memcache_replace(TEXT) RETURNS BOOL
137     AS 'pgmemcache', 'memcache_replace' LANGUAGE 'C';
138    
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     AS 'pgmemcache', 'memcache_replace_absexpire' LANGUAGE 'C';
146    
147     CREATE OR REPLACE FUNCTION memcache_replace(TEXT, TEXT, TIMESTAMP WITH TIME ZONE) RETURNS BOOL
148     AS 'pgmemcache', 'memcache_replace_absexpire' LANGUAGE 'C';
149    
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     AS 'pgmemcache', 'memcache_set' LANGUAGE 'C';
157    
158     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT, INTERVAL) RETURNS BOOL
159     AS 'pgmemcache', 'memcache_set' LANGUAGE 'C';
160    
161     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT) RETURNS BOOL
162     AS 'pgmemcache', 'memcache_set' LANGUAGE 'C';
163    
164     CREATE OR REPLACE FUNCTION memcache_set(TEXT) RETURNS BOOL
165     AS 'pgmemcache', 'memcache_set' LANGUAGE 'C';
166    
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     AS 'pgmemcache', 'memcache_set_absexpire' LANGUAGE 'C';
174    
175     CREATE OR REPLACE FUNCTION memcache_set(TEXT, TEXT, TIMESTAMP WITH TIME ZONE) RETURNS BOOL
176     AS 'pgmemcache', 'memcache_set_absexpire' LANGUAGE 'C';
177    
178    
179     CREATE OR REPLACE FUNCTION memcache_stats() RETURNS TEXT
180     AS 'pgmemcache', 'memcache_stats' LANGUAGE 'C';
181    
182     -- $1 = stat name - TEXT
183     CREATE OR REPLACE FUNCTION memcache_stats(TEXT) RETURNS TEXT
184     AS 'pgmemcache', 'memcache_stat' LANGUAGE 'C';
185    
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     AS 'pgmemcache', 'memcache_flush_all' LANGUAGE 'C';

  ViewVC Help
Powered by ViewVC 1.1.26