]> granicus.if.org Git - postgresql/blob - src/include/utils/builtins.h
has_table_privilege spawns scions has_database_privilege, has_function_privilege,
[postgresql] / src / include / utils / builtins.h
1 /*-------------------------------------------------------------------------
2  *
3  * builtins.h
4  *        Declarations for operations on built-in types.
5  *
6  *
7  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: builtins.h,v 1.190 2002/08/09 16:45:16 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef BUILTINS_H
15 #define BUILTINS_H
16
17 #include "fmgr.h"
18 #include "nodes/parsenodes.h"
19 #include "storage/itemptr.h"    /* for setLastTid() */
20
21 /*
22  *              Defined in adt/
23  */
24
25 /* acl.c */
26 extern Datum has_table_privilege_name_name(PG_FUNCTION_ARGS);
27 extern Datum has_table_privilege_name_id(PG_FUNCTION_ARGS);
28 extern Datum has_table_privilege_id_name(PG_FUNCTION_ARGS);
29 extern Datum has_table_privilege_id_id(PG_FUNCTION_ARGS);
30 extern Datum has_table_privilege_name(PG_FUNCTION_ARGS);
31 extern Datum has_table_privilege_id(PG_FUNCTION_ARGS);
32 extern Datum has_database_privilege_name_name(PG_FUNCTION_ARGS);
33 extern Datum has_database_privilege_name_id(PG_FUNCTION_ARGS);
34 extern Datum has_database_privilege_id_name(PG_FUNCTION_ARGS);
35 extern Datum has_database_privilege_id_id(PG_FUNCTION_ARGS);
36 extern Datum has_database_privilege_name(PG_FUNCTION_ARGS);
37 extern Datum has_database_privilege_id(PG_FUNCTION_ARGS);
38 extern Datum has_function_privilege_name_name(PG_FUNCTION_ARGS);
39 extern Datum has_function_privilege_name_id(PG_FUNCTION_ARGS);
40 extern Datum has_function_privilege_id_name(PG_FUNCTION_ARGS);
41 extern Datum has_function_privilege_id_id(PG_FUNCTION_ARGS);
42 extern Datum has_function_privilege_name(PG_FUNCTION_ARGS);
43 extern Datum has_function_privilege_id(PG_FUNCTION_ARGS);
44 extern Datum has_language_privilege_name_name(PG_FUNCTION_ARGS);
45 extern Datum has_language_privilege_name_id(PG_FUNCTION_ARGS);
46 extern Datum has_language_privilege_id_name(PG_FUNCTION_ARGS);
47 extern Datum has_language_privilege_id_id(PG_FUNCTION_ARGS);
48 extern Datum has_language_privilege_name(PG_FUNCTION_ARGS);
49 extern Datum has_language_privilege_id(PG_FUNCTION_ARGS);
50 extern Datum has_schema_privilege_name_name(PG_FUNCTION_ARGS);
51 extern Datum has_schema_privilege_name_id(PG_FUNCTION_ARGS);
52 extern Datum has_schema_privilege_id_name(PG_FUNCTION_ARGS);
53 extern Datum has_schema_privilege_id_id(PG_FUNCTION_ARGS);
54 extern Datum has_schema_privilege_name(PG_FUNCTION_ARGS);
55 extern Datum has_schema_privilege_id(PG_FUNCTION_ARGS);
56
57 /* bool.c */
58 extern Datum boolin(PG_FUNCTION_ARGS);
59 extern Datum boolout(PG_FUNCTION_ARGS);
60 extern Datum booleq(PG_FUNCTION_ARGS);
61 extern Datum boolne(PG_FUNCTION_ARGS);
62 extern Datum boollt(PG_FUNCTION_ARGS);
63 extern Datum boolgt(PG_FUNCTION_ARGS);
64 extern Datum boolle(PG_FUNCTION_ARGS);
65 extern Datum boolge(PG_FUNCTION_ARGS);
66 extern Datum istrue(PG_FUNCTION_ARGS);
67 extern Datum isfalse(PG_FUNCTION_ARGS);
68 extern Datum isnottrue(PG_FUNCTION_ARGS);
69 extern Datum isnotfalse(PG_FUNCTION_ARGS);
70
71 /* char.c */
72 extern Datum charin(PG_FUNCTION_ARGS);
73 extern Datum charout(PG_FUNCTION_ARGS);
74 extern Datum chareq(PG_FUNCTION_ARGS);
75 extern Datum charne(PG_FUNCTION_ARGS);
76 extern Datum charlt(PG_FUNCTION_ARGS);
77 extern Datum charle(PG_FUNCTION_ARGS);
78 extern Datum chargt(PG_FUNCTION_ARGS);
79 extern Datum charge(PG_FUNCTION_ARGS);
80 extern Datum charpl(PG_FUNCTION_ARGS);
81 extern Datum charmi(PG_FUNCTION_ARGS);
82 extern Datum charmul(PG_FUNCTION_ARGS);
83 extern Datum chardiv(PG_FUNCTION_ARGS);
84 extern Datum text_char(PG_FUNCTION_ARGS);
85 extern Datum char_text(PG_FUNCTION_ARGS);
86 extern Datum cidin(PG_FUNCTION_ARGS);
87 extern Datum cidout(PG_FUNCTION_ARGS);
88 extern Datum cideq(PG_FUNCTION_ARGS);
89
90 /* int.c */
91 extern Datum int2in(PG_FUNCTION_ARGS);
92 extern Datum int2out(PG_FUNCTION_ARGS);
93 extern Datum int2vectorin(PG_FUNCTION_ARGS);
94 extern Datum int2vectorout(PG_FUNCTION_ARGS);
95 extern Datum int2vectoreq(PG_FUNCTION_ARGS);
96 extern Datum int44in(PG_FUNCTION_ARGS);
97 extern Datum int44out(PG_FUNCTION_ARGS);
98 extern Datum int4in(PG_FUNCTION_ARGS);
99 extern Datum int4out(PG_FUNCTION_ARGS);
100 extern Datum i2toi4(PG_FUNCTION_ARGS);
101 extern Datum i4toi2(PG_FUNCTION_ARGS);
102 extern Datum int2_text(PG_FUNCTION_ARGS);
103 extern Datum text_int2(PG_FUNCTION_ARGS);
104 extern Datum int4_text(PG_FUNCTION_ARGS);
105 extern Datum text_int4(PG_FUNCTION_ARGS);
106 extern Datum int4eq(PG_FUNCTION_ARGS);
107 extern Datum int4ne(PG_FUNCTION_ARGS);
108 extern Datum int4lt(PG_FUNCTION_ARGS);
109 extern Datum int4le(PG_FUNCTION_ARGS);
110 extern Datum int4gt(PG_FUNCTION_ARGS);
111 extern Datum int4ge(PG_FUNCTION_ARGS);
112 extern Datum int2eq(PG_FUNCTION_ARGS);
113 extern Datum int2ne(PG_FUNCTION_ARGS);
114 extern Datum int2lt(PG_FUNCTION_ARGS);
115 extern Datum int2le(PG_FUNCTION_ARGS);
116 extern Datum int2gt(PG_FUNCTION_ARGS);
117 extern Datum int2ge(PG_FUNCTION_ARGS);
118 extern Datum int24eq(PG_FUNCTION_ARGS);
119 extern Datum int24ne(PG_FUNCTION_ARGS);
120 extern Datum int24lt(PG_FUNCTION_ARGS);
121 extern Datum int24le(PG_FUNCTION_ARGS);
122 extern Datum int24gt(PG_FUNCTION_ARGS);
123 extern Datum int24ge(PG_FUNCTION_ARGS);
124 extern Datum int42eq(PG_FUNCTION_ARGS);
125 extern Datum int42ne(PG_FUNCTION_ARGS);
126 extern Datum int42lt(PG_FUNCTION_ARGS);
127 extern Datum int42le(PG_FUNCTION_ARGS);
128 extern Datum int42gt(PG_FUNCTION_ARGS);
129 extern Datum int42ge(PG_FUNCTION_ARGS);
130 extern Datum int4um(PG_FUNCTION_ARGS);
131 extern Datum int4up(PG_FUNCTION_ARGS);
132 extern Datum int4pl(PG_FUNCTION_ARGS);
133 extern Datum int4mi(PG_FUNCTION_ARGS);
134 extern Datum int4mul(PG_FUNCTION_ARGS);
135 extern Datum int4div(PG_FUNCTION_ARGS);
136 extern Datum int4abs(PG_FUNCTION_ARGS);
137 extern Datum int4inc(PG_FUNCTION_ARGS);
138 extern Datum int2um(PG_FUNCTION_ARGS);
139 extern Datum int2up(PG_FUNCTION_ARGS);
140 extern Datum int2pl(PG_FUNCTION_ARGS);
141 extern Datum int2mi(PG_FUNCTION_ARGS);
142 extern Datum int2mul(PG_FUNCTION_ARGS);
143 extern Datum int2div(PG_FUNCTION_ARGS);
144 extern Datum int2abs(PG_FUNCTION_ARGS);
145 extern Datum int24pl(PG_FUNCTION_ARGS);
146 extern Datum int24mi(PG_FUNCTION_ARGS);
147 extern Datum int24mul(PG_FUNCTION_ARGS);
148 extern Datum int24div(PG_FUNCTION_ARGS);
149 extern Datum int42pl(PG_FUNCTION_ARGS);
150 extern Datum int42mi(PG_FUNCTION_ARGS);
151 extern Datum int42mul(PG_FUNCTION_ARGS);
152 extern Datum int42div(PG_FUNCTION_ARGS);
153 extern Datum int4mod(PG_FUNCTION_ARGS);
154 extern Datum int2mod(PG_FUNCTION_ARGS);
155 extern Datum int24mod(PG_FUNCTION_ARGS);
156 extern Datum int42mod(PG_FUNCTION_ARGS);
157 extern Datum int4fac(PG_FUNCTION_ARGS);
158 extern Datum int2fac(PG_FUNCTION_ARGS);
159 extern Datum int2larger(PG_FUNCTION_ARGS);
160 extern Datum int2smaller(PG_FUNCTION_ARGS);
161 extern Datum int4larger(PG_FUNCTION_ARGS);
162 extern Datum int4smaller(PG_FUNCTION_ARGS);
163
164 extern Datum int4and(PG_FUNCTION_ARGS);
165 extern Datum int4or(PG_FUNCTION_ARGS);
166 extern Datum int4xor(PG_FUNCTION_ARGS);
167 extern Datum int4not(PG_FUNCTION_ARGS);
168 extern Datum int4shl(PG_FUNCTION_ARGS);
169 extern Datum int4shr(PG_FUNCTION_ARGS);
170 extern Datum int2and(PG_FUNCTION_ARGS);
171 extern Datum int2or(PG_FUNCTION_ARGS);
172 extern Datum int2xor(PG_FUNCTION_ARGS);
173 extern Datum int2not(PG_FUNCTION_ARGS);
174 extern Datum int2shl(PG_FUNCTION_ARGS);
175 extern Datum int2shr(PG_FUNCTION_ARGS);
176
177 /* name.c */
178 extern Datum namein(PG_FUNCTION_ARGS);
179 extern Datum nameout(PG_FUNCTION_ARGS);
180 extern Datum nameeq(PG_FUNCTION_ARGS);
181 extern Datum namene(PG_FUNCTION_ARGS);
182 extern Datum namelt(PG_FUNCTION_ARGS);
183 extern Datum namele(PG_FUNCTION_ARGS);
184 extern Datum namegt(PG_FUNCTION_ARGS);
185 extern Datum namege(PG_FUNCTION_ARGS);
186 extern int      namecpy(Name n1, Name n2);
187 extern int      namestrcpy(Name name, const char *str);
188 extern int      namestrcmp(Name name, const char *str);
189 extern Datum current_user(PG_FUNCTION_ARGS);
190 extern Datum session_user(PG_FUNCTION_ARGS);
191 extern Datum current_schema(PG_FUNCTION_ARGS);
192 extern Datum current_schemas(PG_FUNCTION_ARGS);
193
194 /* numutils.c */
195 extern int32 pg_atoi(char *s, int size, int c);
196 extern void pg_itoa(int16 i, char *a);
197 extern void pg_ltoa(int32 l, char *a);
198
199 /*
200  *              Per-opclass comparison functions for new btrees.  These are
201  *              stored in pg_amproc and defined in access/nbtree/nbtcompare.c
202  */
203 extern Datum btboolcmp(PG_FUNCTION_ARGS);
204 extern Datum btint2cmp(PG_FUNCTION_ARGS);
205 extern Datum btint4cmp(PG_FUNCTION_ARGS);
206 extern Datum btint8cmp(PG_FUNCTION_ARGS);
207 extern Datum btfloat4cmp(PG_FUNCTION_ARGS);
208 extern Datum btfloat8cmp(PG_FUNCTION_ARGS);
209 extern Datum btoidcmp(PG_FUNCTION_ARGS);
210 extern Datum btoidvectorcmp(PG_FUNCTION_ARGS);
211 extern Datum btabstimecmp(PG_FUNCTION_ARGS);
212 extern Datum btcharcmp(PG_FUNCTION_ARGS);
213 extern Datum btnamecmp(PG_FUNCTION_ARGS);
214 extern Datum bttextcmp(PG_FUNCTION_ARGS);
215
216 /* float.c */
217 extern Datum float4in(PG_FUNCTION_ARGS);
218 extern Datum float4out(PG_FUNCTION_ARGS);
219 extern Datum float8in(PG_FUNCTION_ARGS);
220 extern Datum float8out(PG_FUNCTION_ARGS);
221 extern Datum float4abs(PG_FUNCTION_ARGS);
222 extern Datum float4um(PG_FUNCTION_ARGS);
223 extern Datum float4up(PG_FUNCTION_ARGS);
224 extern Datum float4larger(PG_FUNCTION_ARGS);
225 extern Datum float4smaller(PG_FUNCTION_ARGS);
226 extern Datum float8abs(PG_FUNCTION_ARGS);
227 extern Datum float8um(PG_FUNCTION_ARGS);
228 extern Datum float8up(PG_FUNCTION_ARGS);
229 extern Datum float8larger(PG_FUNCTION_ARGS);
230 extern Datum float8smaller(PG_FUNCTION_ARGS);
231 extern Datum float4pl(PG_FUNCTION_ARGS);
232 extern Datum float4mi(PG_FUNCTION_ARGS);
233 extern Datum float4mul(PG_FUNCTION_ARGS);
234 extern Datum float4div(PG_FUNCTION_ARGS);
235 extern Datum float8pl(PG_FUNCTION_ARGS);
236 extern Datum float8mi(PG_FUNCTION_ARGS);
237 extern Datum float8mul(PG_FUNCTION_ARGS);
238 extern Datum float8div(PG_FUNCTION_ARGS);
239 extern Datum float4eq(PG_FUNCTION_ARGS);
240 extern Datum float4ne(PG_FUNCTION_ARGS);
241 extern Datum float4lt(PG_FUNCTION_ARGS);
242 extern Datum float4le(PG_FUNCTION_ARGS);
243 extern Datum float4gt(PG_FUNCTION_ARGS);
244 extern Datum float4ge(PG_FUNCTION_ARGS);
245 extern Datum float8eq(PG_FUNCTION_ARGS);
246 extern Datum float8ne(PG_FUNCTION_ARGS);
247 extern Datum float8lt(PG_FUNCTION_ARGS);
248 extern Datum float8le(PG_FUNCTION_ARGS);
249 extern Datum float8gt(PG_FUNCTION_ARGS);
250 extern Datum float8ge(PG_FUNCTION_ARGS);
251 extern Datum ftod(PG_FUNCTION_ARGS);
252 extern Datum i4tod(PG_FUNCTION_ARGS);
253 extern Datum i2tod(PG_FUNCTION_ARGS);
254 extern Datum dtof(PG_FUNCTION_ARGS);
255 extern Datum dtoi4(PG_FUNCTION_ARGS);
256 extern Datum dtoi2(PG_FUNCTION_ARGS);
257 extern Datum i4tof(PG_FUNCTION_ARGS);
258 extern Datum i2tof(PG_FUNCTION_ARGS);
259 extern Datum ftoi4(PG_FUNCTION_ARGS);
260 extern Datum ftoi2(PG_FUNCTION_ARGS);
261 extern Datum text_float8(PG_FUNCTION_ARGS);
262 extern Datum text_float4(PG_FUNCTION_ARGS);
263 extern Datum float8_text(PG_FUNCTION_ARGS);
264 extern Datum float4_text(PG_FUNCTION_ARGS);
265 extern Datum dround(PG_FUNCTION_ARGS);
266 extern Datum dtrunc(PG_FUNCTION_ARGS);
267 extern Datum dsqrt(PG_FUNCTION_ARGS);
268 extern Datum dcbrt(PG_FUNCTION_ARGS);
269 extern Datum dpow(PG_FUNCTION_ARGS);
270 extern Datum dexp(PG_FUNCTION_ARGS);
271 extern Datum dlog1(PG_FUNCTION_ARGS);
272 extern Datum dlog10(PG_FUNCTION_ARGS);
273 extern Datum dacos(PG_FUNCTION_ARGS);
274 extern Datum dasin(PG_FUNCTION_ARGS);
275 extern Datum datan(PG_FUNCTION_ARGS);
276 extern Datum datan2(PG_FUNCTION_ARGS);
277 extern Datum dcos(PG_FUNCTION_ARGS);
278 extern Datum dcot(PG_FUNCTION_ARGS);
279 extern Datum dsin(PG_FUNCTION_ARGS);
280 extern Datum dtan(PG_FUNCTION_ARGS);
281 extern Datum degrees(PG_FUNCTION_ARGS);
282 extern Datum dpi(PG_FUNCTION_ARGS);
283 extern Datum radians(PG_FUNCTION_ARGS);
284 extern Datum drandom(PG_FUNCTION_ARGS);
285 extern Datum setseed(PG_FUNCTION_ARGS);
286 extern Datum float8_accum(PG_FUNCTION_ARGS);
287 extern Datum float4_accum(PG_FUNCTION_ARGS);
288 extern Datum float8_avg(PG_FUNCTION_ARGS);
289 extern Datum float8_variance(PG_FUNCTION_ARGS);
290 extern Datum float8_stddev(PG_FUNCTION_ARGS);
291 extern Datum float48pl(PG_FUNCTION_ARGS);
292 extern Datum float48mi(PG_FUNCTION_ARGS);
293 extern Datum float48mul(PG_FUNCTION_ARGS);
294 extern Datum float48div(PG_FUNCTION_ARGS);
295 extern Datum float84pl(PG_FUNCTION_ARGS);
296 extern Datum float84mi(PG_FUNCTION_ARGS);
297 extern Datum float84mul(PG_FUNCTION_ARGS);
298 extern Datum float84div(PG_FUNCTION_ARGS);
299 extern Datum float48eq(PG_FUNCTION_ARGS);
300 extern Datum float48ne(PG_FUNCTION_ARGS);
301 extern Datum float48lt(PG_FUNCTION_ARGS);
302 extern Datum float48le(PG_FUNCTION_ARGS);
303 extern Datum float48gt(PG_FUNCTION_ARGS);
304 extern Datum float48ge(PG_FUNCTION_ARGS);
305 extern Datum float84eq(PG_FUNCTION_ARGS);
306 extern Datum float84ne(PG_FUNCTION_ARGS);
307 extern Datum float84lt(PG_FUNCTION_ARGS);
308 extern Datum float84le(PG_FUNCTION_ARGS);
309 extern Datum float84gt(PG_FUNCTION_ARGS);
310 extern Datum float84ge(PG_FUNCTION_ARGS);
311
312 /* misc.c */
313 extern Datum nullvalue(PG_FUNCTION_ARGS);
314 extern Datum nonnullvalue(PG_FUNCTION_ARGS);
315 extern Datum oidrand(PG_FUNCTION_ARGS);
316 extern Datum oidsrand(PG_FUNCTION_ARGS);
317 extern Datum userfntest(PG_FUNCTION_ARGS);
318
319 /* not_in.c */
320 extern Datum int4notin(PG_FUNCTION_ARGS);
321 extern Datum oidnotin(PG_FUNCTION_ARGS);
322
323 /* oid.c */
324 extern Datum oidin(PG_FUNCTION_ARGS);
325 extern Datum oidout(PG_FUNCTION_ARGS);
326 extern Datum oideq(PG_FUNCTION_ARGS);
327 extern Datum oidne(PG_FUNCTION_ARGS);
328 extern Datum oidlt(PG_FUNCTION_ARGS);
329 extern Datum oidle(PG_FUNCTION_ARGS);
330 extern Datum oidge(PG_FUNCTION_ARGS);
331 extern Datum oidgt(PG_FUNCTION_ARGS);
332 extern Datum oidlarger(PG_FUNCTION_ARGS);
333 extern Datum oidsmaller(PG_FUNCTION_ARGS);
334 extern Datum oid_text(PG_FUNCTION_ARGS);
335 extern Datum text_oid(PG_FUNCTION_ARGS);
336 extern Datum oidvectorin(PG_FUNCTION_ARGS);
337 extern Datum oidvectorout(PG_FUNCTION_ARGS);
338 extern Datum oidvectoreq(PG_FUNCTION_ARGS);
339 extern Datum oidvectorne(PG_FUNCTION_ARGS);
340 extern Datum oidvectorlt(PG_FUNCTION_ARGS);
341 extern Datum oidvectorle(PG_FUNCTION_ARGS);
342 extern Datum oidvectorge(PG_FUNCTION_ARGS);
343 extern Datum oidvectorgt(PG_FUNCTION_ARGS);
344
345 /* regexp.c */
346 extern Datum nameregexeq(PG_FUNCTION_ARGS);
347 extern Datum nameregexne(PG_FUNCTION_ARGS);
348 extern Datum textregexeq(PG_FUNCTION_ARGS);
349 extern Datum textregexne(PG_FUNCTION_ARGS);
350 extern Datum nameicregexeq(PG_FUNCTION_ARGS);
351 extern Datum nameicregexne(PG_FUNCTION_ARGS);
352 extern Datum texticregexeq(PG_FUNCTION_ARGS);
353 extern Datum texticregexne(PG_FUNCTION_ARGS);
354 extern Datum textregexsubstr(PG_FUNCTION_ARGS);
355
356 /* regproc.c */
357 extern Datum regprocin(PG_FUNCTION_ARGS);
358 extern Datum regprocout(PG_FUNCTION_ARGS);
359 extern Datum regprocedurein(PG_FUNCTION_ARGS);
360 extern Datum regprocedureout(PG_FUNCTION_ARGS);
361 extern Datum regoperin(PG_FUNCTION_ARGS);
362 extern Datum regoperout(PG_FUNCTION_ARGS);
363 extern Datum regoperatorin(PG_FUNCTION_ARGS);
364 extern Datum regoperatorout(PG_FUNCTION_ARGS);
365 extern Datum regclassin(PG_FUNCTION_ARGS);
366 extern Datum regclassout(PG_FUNCTION_ARGS);
367 extern Datum regtypein(PG_FUNCTION_ARGS);
368 extern Datum regtypeout(PG_FUNCTION_ARGS);
369 extern List *stringToQualifiedNameList(const char *string, const char *caller);
370 extern char *format_procedure(Oid procedure_oid);
371 extern char *format_operator(Oid operator_oid);
372
373 /* ruleutils.c */
374 extern Datum pg_get_ruledef(PG_FUNCTION_ARGS);
375 extern Datum pg_get_viewdef(PG_FUNCTION_ARGS);
376 extern Datum pg_get_viewdef_name(PG_FUNCTION_ARGS);
377 extern Datum pg_get_indexdef(PG_FUNCTION_ARGS);
378 extern Datum pg_get_userbyid(PG_FUNCTION_ARGS);
379 extern Datum pg_get_expr(PG_FUNCTION_ARGS);
380 extern char *deparse_expression(Node *expr, List *dpcontext,
381                                    bool forceprefix);
382 extern List *deparse_context_for(const char *aliasname, Oid relid);
383 extern List *deparse_context_for_plan(int outer_varno, Node *outercontext,
384                                                                           int inner_varno, Node *innercontext,
385                                                                           List *rtable);
386 extern Node *deparse_context_for_rte(RangeTblEntry *rte);
387 extern Node *deparse_context_for_subplan(const char *name, List *tlist,
388                                                                                  List *rtable);
389 extern const char *quote_identifier(const char *ident);
390 extern char *quote_qualified_identifier(const char *namespace,
391                                                                                 const char *ident);
392
393 /* tid.c */
394 extern void setLastTid(const ItemPointer tid);
395 extern Datum tidin(PG_FUNCTION_ARGS);
396 extern Datum tidout(PG_FUNCTION_ARGS);
397 extern Datum tideq(PG_FUNCTION_ARGS);
398 extern Datum currtid_byreloid(PG_FUNCTION_ARGS);
399 extern Datum currtid_byrelname(PG_FUNCTION_ARGS);
400
401 /* varchar.c */
402 extern Datum bpcharin(PG_FUNCTION_ARGS);
403 extern Datum bpcharout(PG_FUNCTION_ARGS);
404 extern Datum bpchar(PG_FUNCTION_ARGS);
405 extern Datum _bpchar(PG_FUNCTION_ARGS);
406 extern Datum char_bpchar(PG_FUNCTION_ARGS);
407 extern Datum name_bpchar(PG_FUNCTION_ARGS);
408 extern Datum bpchar_name(PG_FUNCTION_ARGS);
409 extern Datum bpchareq(PG_FUNCTION_ARGS);
410 extern Datum bpcharne(PG_FUNCTION_ARGS);
411 extern Datum bpcharlt(PG_FUNCTION_ARGS);
412 extern Datum bpcharle(PG_FUNCTION_ARGS);
413 extern Datum bpchargt(PG_FUNCTION_ARGS);
414 extern Datum bpcharge(PG_FUNCTION_ARGS);
415 extern Datum bpcharcmp(PG_FUNCTION_ARGS);
416 extern Datum bpcharlen(PG_FUNCTION_ARGS);
417 extern Datum bpcharoctetlen(PG_FUNCTION_ARGS);
418 extern Datum hashbpchar(PG_FUNCTION_ARGS);
419
420 extern Datum varcharin(PG_FUNCTION_ARGS);
421 extern Datum varcharout(PG_FUNCTION_ARGS);
422 extern Datum varchar(PG_FUNCTION_ARGS);
423 extern Datum _varchar(PG_FUNCTION_ARGS);
424 extern Datum varchareq(PG_FUNCTION_ARGS);
425 extern Datum varcharne(PG_FUNCTION_ARGS);
426 extern Datum varcharlt(PG_FUNCTION_ARGS);
427 extern Datum varcharle(PG_FUNCTION_ARGS);
428 extern Datum varchargt(PG_FUNCTION_ARGS);
429 extern Datum varcharge(PG_FUNCTION_ARGS);
430 extern Datum varcharcmp(PG_FUNCTION_ARGS);
431 extern Datum varcharlen(PG_FUNCTION_ARGS);
432 extern Datum varcharoctetlen(PG_FUNCTION_ARGS);
433
434 /* varlena.c */
435 extern Datum textin(PG_FUNCTION_ARGS);
436 extern Datum textout(PG_FUNCTION_ARGS);
437 extern Datum textcat(PG_FUNCTION_ARGS);
438 extern Datum texteq(PG_FUNCTION_ARGS);
439 extern Datum textne(PG_FUNCTION_ARGS);
440 extern Datum text_lt(PG_FUNCTION_ARGS);
441 extern Datum text_le(PG_FUNCTION_ARGS);
442 extern Datum text_gt(PG_FUNCTION_ARGS);
443 extern Datum text_ge(PG_FUNCTION_ARGS);
444 extern Datum text_larger(PG_FUNCTION_ARGS);
445 extern Datum text_smaller(PG_FUNCTION_ARGS);
446 extern Datum textlen(PG_FUNCTION_ARGS);
447 extern Datum textoctetlen(PG_FUNCTION_ARGS);
448 extern Datum textpos(PG_FUNCTION_ARGS);
449 extern Datum text_substr(PG_FUNCTION_ARGS);
450 extern Datum name_text(PG_FUNCTION_ARGS);
451 extern Datum text_name(PG_FUNCTION_ARGS);
452 extern int      varstr_cmp(char *arg1, int len1, char *arg2, int len2);
453 extern List *textToQualifiedNameList(text *textval, const char *caller);
454 extern bool SplitIdentifierString(char *rawstring, char separator,
455                                                                   List **namelist);
456
457 extern Datum unknownin(PG_FUNCTION_ARGS);
458 extern Datum unknownout(PG_FUNCTION_ARGS);
459
460 extern Datum byteain(PG_FUNCTION_ARGS);
461 extern Datum byteaout(PG_FUNCTION_ARGS);
462 extern Datum byteaoctetlen(PG_FUNCTION_ARGS);
463 extern Datum byteaGetByte(PG_FUNCTION_ARGS);
464 extern Datum byteaGetBit(PG_FUNCTION_ARGS);
465 extern Datum byteaSetByte(PG_FUNCTION_ARGS);
466 extern Datum byteaSetBit(PG_FUNCTION_ARGS);
467 extern Datum binary_encode(PG_FUNCTION_ARGS);
468 extern Datum binary_decode(PG_FUNCTION_ARGS);
469 extern Datum byteaeq(PG_FUNCTION_ARGS);
470 extern Datum byteane(PG_FUNCTION_ARGS);
471 extern Datum bytealt(PG_FUNCTION_ARGS);
472 extern Datum byteale(PG_FUNCTION_ARGS);
473 extern Datum byteagt(PG_FUNCTION_ARGS);
474 extern Datum byteage(PG_FUNCTION_ARGS);
475 extern Datum byteacmp(PG_FUNCTION_ARGS);
476 extern Datum byteacat(PG_FUNCTION_ARGS);
477 extern Datum byteapos(PG_FUNCTION_ARGS);
478 extern Datum bytea_substr(PG_FUNCTION_ARGS);
479
480 /* version.c */
481 extern Datum pgsql_version(PG_FUNCTION_ARGS);
482
483 /* like.c */
484 extern Datum namelike(PG_FUNCTION_ARGS);
485 extern Datum namenlike(PG_FUNCTION_ARGS);
486 extern Datum nameiclike(PG_FUNCTION_ARGS);
487 extern Datum nameicnlike(PG_FUNCTION_ARGS);
488 extern Datum textlike(PG_FUNCTION_ARGS);
489 extern Datum textnlike(PG_FUNCTION_ARGS);
490 extern Datum texticlike(PG_FUNCTION_ARGS);
491 extern Datum texticnlike(PG_FUNCTION_ARGS);
492 extern Datum bytealike(PG_FUNCTION_ARGS);
493 extern Datum byteanlike(PG_FUNCTION_ARGS);
494 extern Datum like_escape(PG_FUNCTION_ARGS);
495 extern Datum like_escape_bytea(PG_FUNCTION_ARGS);
496
497 /* oracle_compat.c */
498 extern Datum lower(PG_FUNCTION_ARGS);
499 extern Datum upper(PG_FUNCTION_ARGS);
500 extern Datum initcap(PG_FUNCTION_ARGS);
501 extern Datum lpad(PG_FUNCTION_ARGS);
502 extern Datum rpad(PG_FUNCTION_ARGS);
503 extern Datum btrim(PG_FUNCTION_ARGS);
504 extern Datum byteatrim(PG_FUNCTION_ARGS);
505 extern Datum ltrim(PG_FUNCTION_ARGS);
506 extern Datum rtrim(PG_FUNCTION_ARGS);
507 extern Datum translate(PG_FUNCTION_ARGS);
508 extern Datum chr(PG_FUNCTION_ARGS);
509 extern Datum repeat(PG_FUNCTION_ARGS);
510 extern Datum ascii(PG_FUNCTION_ARGS);
511
512 /* inet_net_ntop.c */
513 extern char *inet_net_ntop(int af, const void *src, int bits,
514                           char *dst, size_t size);
515 extern char *inet_cidr_ntop(int af, const void *src, int bits,
516                            char *dst, size_t size);
517
518 /* inet_net_pton.c */
519 extern int inet_net_pton(int af, const char *src,
520                           void *dst, size_t size);
521
522 /* network.c */
523 extern Datum inet_in(PG_FUNCTION_ARGS);
524 extern Datum inet_out(PG_FUNCTION_ARGS);
525 extern Datum cidr_in(PG_FUNCTION_ARGS);
526 extern Datum cidr_out(PG_FUNCTION_ARGS);
527 extern Datum network_cmp(PG_FUNCTION_ARGS);
528 extern Datum network_lt(PG_FUNCTION_ARGS);
529 extern Datum network_le(PG_FUNCTION_ARGS);
530 extern Datum network_eq(PG_FUNCTION_ARGS);
531 extern Datum network_ge(PG_FUNCTION_ARGS);
532 extern Datum network_gt(PG_FUNCTION_ARGS);
533 extern Datum network_ne(PG_FUNCTION_ARGS);
534 extern Datum network_sub(PG_FUNCTION_ARGS);
535 extern Datum network_subeq(PG_FUNCTION_ARGS);
536 extern Datum network_sup(PG_FUNCTION_ARGS);
537 extern Datum network_supeq(PG_FUNCTION_ARGS);
538 extern Datum network_network(PG_FUNCTION_ARGS);
539 extern Datum network_netmask(PG_FUNCTION_ARGS);
540 extern Datum network_masklen(PG_FUNCTION_ARGS);
541 extern Datum network_broadcast(PG_FUNCTION_ARGS);
542 extern Datum network_host(PG_FUNCTION_ARGS);
543 extern Datum network_show(PG_FUNCTION_ARGS);
544 extern Datum network_abbrev(PG_FUNCTION_ARGS);
545 extern double convert_network_to_scalar(Datum value, Oid typid);
546 extern Datum text_cidr(PG_FUNCTION_ARGS);
547 extern Datum text_inet(PG_FUNCTION_ARGS);
548 extern Datum inet_set_masklen(PG_FUNCTION_ARGS);
549 extern Datum network_scan_first(Datum in);
550 extern Datum network_scan_last(Datum in);
551
552 /* mac.c */
553 extern Datum macaddr_in(PG_FUNCTION_ARGS);
554 extern Datum macaddr_out(PG_FUNCTION_ARGS);
555 extern Datum macaddr_cmp(PG_FUNCTION_ARGS);
556 extern Datum macaddr_lt(PG_FUNCTION_ARGS);
557 extern Datum macaddr_le(PG_FUNCTION_ARGS);
558 extern Datum macaddr_eq(PG_FUNCTION_ARGS);
559 extern Datum macaddr_ge(PG_FUNCTION_ARGS);
560 extern Datum macaddr_gt(PG_FUNCTION_ARGS);
561 extern Datum macaddr_ne(PG_FUNCTION_ARGS);
562 extern Datum macaddr_trunc(PG_FUNCTION_ARGS);
563 extern Datum macaddr_text(PG_FUNCTION_ARGS);
564 extern Datum text_macaddr(PG_FUNCTION_ARGS);
565 extern Datum hashmacaddr(PG_FUNCTION_ARGS);
566
567 /* numeric.c */
568 extern Datum numeric_in(PG_FUNCTION_ARGS);
569 extern Datum numeric_out(PG_FUNCTION_ARGS);
570 extern Datum numeric(PG_FUNCTION_ARGS);
571 extern Datum numeric_abs(PG_FUNCTION_ARGS);
572 extern Datum numeric_uminus(PG_FUNCTION_ARGS);
573 extern Datum numeric_uplus(PG_FUNCTION_ARGS);
574 extern Datum numeric_sign(PG_FUNCTION_ARGS);
575 extern Datum numeric_round(PG_FUNCTION_ARGS);
576 extern Datum numeric_trunc(PG_FUNCTION_ARGS);
577 extern Datum numeric_ceil(PG_FUNCTION_ARGS);
578 extern Datum numeric_floor(PG_FUNCTION_ARGS);
579 extern Datum numeric_cmp(PG_FUNCTION_ARGS);
580 extern Datum numeric_eq(PG_FUNCTION_ARGS);
581 extern Datum numeric_ne(PG_FUNCTION_ARGS);
582 extern Datum numeric_gt(PG_FUNCTION_ARGS);
583 extern Datum numeric_ge(PG_FUNCTION_ARGS);
584 extern Datum numeric_lt(PG_FUNCTION_ARGS);
585 extern Datum numeric_le(PG_FUNCTION_ARGS);
586 extern Datum numeric_add(PG_FUNCTION_ARGS);
587 extern Datum numeric_sub(PG_FUNCTION_ARGS);
588 extern Datum numeric_mul(PG_FUNCTION_ARGS);
589 extern Datum numeric_div(PG_FUNCTION_ARGS);
590 extern Datum numeric_mod(PG_FUNCTION_ARGS);
591 extern Datum numeric_inc(PG_FUNCTION_ARGS);
592 extern Datum numeric_smaller(PG_FUNCTION_ARGS);
593 extern Datum numeric_larger(PG_FUNCTION_ARGS);
594 extern Datum numeric_sqrt(PG_FUNCTION_ARGS);
595 extern Datum numeric_exp(PG_FUNCTION_ARGS);
596 extern Datum numeric_ln(PG_FUNCTION_ARGS);
597 extern Datum numeric_log(PG_FUNCTION_ARGS);
598 extern Datum numeric_power(PG_FUNCTION_ARGS);
599 extern Datum int4_numeric(PG_FUNCTION_ARGS);
600 extern Datum numeric_int4(PG_FUNCTION_ARGS);
601 extern Datum int8_numeric(PG_FUNCTION_ARGS);
602 extern Datum numeric_int8(PG_FUNCTION_ARGS);
603 extern Datum int2_numeric(PG_FUNCTION_ARGS);
604 extern Datum numeric_int2(PG_FUNCTION_ARGS);
605 extern Datum float8_numeric(PG_FUNCTION_ARGS);
606 extern Datum numeric_float8(PG_FUNCTION_ARGS);
607 extern Datum numeric_float8_no_overflow(PG_FUNCTION_ARGS);
608 extern Datum float4_numeric(PG_FUNCTION_ARGS);
609 extern Datum numeric_float4(PG_FUNCTION_ARGS);
610 extern Datum numeric_accum(PG_FUNCTION_ARGS);
611 extern Datum int2_accum(PG_FUNCTION_ARGS);
612 extern Datum int4_accum(PG_FUNCTION_ARGS);
613 extern Datum int8_accum(PG_FUNCTION_ARGS);
614 extern Datum numeric_avg(PG_FUNCTION_ARGS);
615 extern Datum numeric_variance(PG_FUNCTION_ARGS);
616 extern Datum numeric_stddev(PG_FUNCTION_ARGS);
617 extern Datum int2_sum(PG_FUNCTION_ARGS);
618 extern Datum int4_sum(PG_FUNCTION_ARGS);
619 extern Datum int8_sum(PG_FUNCTION_ARGS);
620 extern Datum int2_avg_accum(PG_FUNCTION_ARGS);
621 extern Datum int4_avg_accum(PG_FUNCTION_ARGS);
622 extern Datum int8_avg(PG_FUNCTION_ARGS);
623
624 /* ri_triggers.c */
625 extern Datum RI_FKey_check_ins(PG_FUNCTION_ARGS);
626 extern Datum RI_FKey_check_upd(PG_FUNCTION_ARGS);
627 extern Datum RI_FKey_noaction_del(PG_FUNCTION_ARGS);
628 extern Datum RI_FKey_noaction_upd(PG_FUNCTION_ARGS);
629 extern Datum RI_FKey_cascade_del(PG_FUNCTION_ARGS);
630 extern Datum RI_FKey_cascade_upd(PG_FUNCTION_ARGS);
631 extern Datum RI_FKey_restrict_del(PG_FUNCTION_ARGS);
632 extern Datum RI_FKey_restrict_upd(PG_FUNCTION_ARGS);
633 extern Datum RI_FKey_setnull_del(PG_FUNCTION_ARGS);
634 extern Datum RI_FKey_setnull_upd(PG_FUNCTION_ARGS);
635 extern Datum RI_FKey_setdefault_del(PG_FUNCTION_ARGS);
636 extern Datum RI_FKey_setdefault_upd(PG_FUNCTION_ARGS);
637
638 /* even if MULTIBYTE is not enabled, these functions are necessary
639  * since pg_proc.h has references to them.
640  */
641 extern Datum getdatabaseencoding(PG_FUNCTION_ARGS);
642 extern Datum database_character_set(PG_FUNCTION_ARGS);
643 extern Datum pg_client_encoding(PG_FUNCTION_ARGS);
644 extern Datum PG_encoding_to_char(PG_FUNCTION_ARGS);
645 extern Datum PG_char_to_encoding(PG_FUNCTION_ARGS);
646 extern Datum PG_character_set_name(PG_FUNCTION_ARGS);
647 extern Datum PG_character_set_id(PG_FUNCTION_ARGS);
648 extern Datum pg_convert(PG_FUNCTION_ARGS);
649 extern Datum pg_convert2(PG_FUNCTION_ARGS);
650
651 /* format_type.c */
652 extern Datum format_type(PG_FUNCTION_ARGS);
653 extern char *format_type_be(Oid type_oid);
654 extern char *format_type_with_typemod(Oid type_oid, int32 typemod);
655 extern Datum oidvectortypes(PG_FUNCTION_ARGS);
656 extern int32 type_maximum_size(Oid type_oid, int32 typemod);
657
658 /* quote.c */
659 extern Datum quote_ident(PG_FUNCTION_ARGS);
660 extern Datum quote_literal(PG_FUNCTION_ARGS);
661
662 /* guc.c */
663 extern Datum show_config_by_name(PG_FUNCTION_ARGS);
664 extern Datum set_config_by_name(PG_FUNCTION_ARGS);
665
666 /* catalog/pg_conversion.c */
667 extern Datum pg_convert3(PG_FUNCTION_ARGS);
668
669 #endif   /* BUILTINS_H */