From 6d30fb1f75a57d80f80e27770d39d88f8aa32d28 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 8 Nov 2016 13:11:15 -0500 Subject: Make SPI_fnumber() reject dropped columns. There's basically no scenario where it's sensible for this to match dropped columns, so put a test for dropped-ness into SPI_fnumber() itself, and excise the test from the small number of callers that were paying attention to the case. (Most weren't :-(.) In passing, normalize tests at call sites: always reject attnum <= 0 if we're disallowing system columns. Previously there was a mixture of "< 0" and "<= 0" tests. This makes no practical difference since SPI_fnumber() never returns 0, but I'm feeling pedantic today. Also, in the places that are actually live user-facing code and not legacy cruft, distinguish "column not found" from "can't handle system column". Per discussion with Jim Nasby; thi supersedes his original patch that just changed the behavior at one call site. Discussion: --- contrib/spi/moddatetime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/spi/moddatetime.c') diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c index c6d33b7355..cd700fe6d1 100644 --- a/contrib/spi/moddatetime.c +++ b/contrib/spi/moddatetime.c @@ -84,9 +84,9 @@ moddatetime(PG_FUNCTION_ARGS) /* * This is where we check to see if the field we are supposed to update - * even exists. The above function must return -1 if name not found? + * even exists. */ - if (attnum < 0) + if (attnum <= 0) ereport(ERROR, (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), errmsg("\"%s\" has no attribute \"%s\"", -- cgit v1.2.3 From 9257f0787257022e31c61cd77449127adfccf37f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 8 Nov 2016 15:36:36 -0500 Subject: Replace uses of SPI_modifytuple that intend to allocate in current context. Invent a new function heap_modify_tuple_by_cols() that is functionally equivalent to SPI_modifytuple except that it always allocates its result by simple palloc. I chose however to make the API details a bit more like heap_modify_tuple: pass a tupdesc rather than a Relation, and use bool convention for the isnull array. Use this function in place of SPI_modifytuple at all call sites where the intended behavior is to allocate in current context. (There actually are only two call sites left that depend on the old behavior, which makes me wonder if we should just drop this function rather than keep it.) This new function is easier to use than heap_modify_tuple() for purposes of replacing a single column (or, really, any fixed number of columns). There are a number of places where it would simplify the code to change over, but I resisted that temptation for the moment ... everywhere except in plpgsql's exec_assign_value(); changing that might offer some small performance benefit, so I did it. This is on the way to removing SPI_push/SPI_pop, but it seems like good code cleanup in its own right. Discussion: <9633.1478552022@sss.pgh.pa.us> --- contrib/spi/autoinc.c | 13 ++++--- contrib/spi/insert_username.c | 12 +++---- contrib/spi/moddatetime.c | 21 ++++------- contrib/spi/timetravel.c | 25 ++++++------- doc/src/sgml/spi.sgml | 5 +-- src/backend/access/common/heaptuple.c | 66 +++++++++++++++++++++++++++++++++++ src/backend/utils/adt/tsvector_op.c | 16 ++++----- src/include/access/htup_details.h | 6 ++++ src/pl/plpgsql/src/pl_exec.c | 57 ++++++++++-------------------- src/test/regress/regress.c | 11 ++---- 10 files changed, 137 insertions(+), 95 deletions(-) (limited to 'contrib/spi/moddatetime.c') diff --git a/contrib/spi/autoinc.c b/contrib/spi/autoinc.c index fc657a7c06..54f85a3709 100644 --- a/contrib/spi/autoinc.c +++ b/contrib/spi/autoinc.c @@ -3,6 +3,7 @@ */ #include "postgres.h" +#include "access/htup_details.h" #include "catalog/pg_type.h" #include "commands/sequence.h" #include "commands/trigger.h" @@ -23,6 +24,7 @@ autoinc(PG_FUNCTION_ARGS) int *chattrs; /* attnums of attributes to change */ int chnattrs = 0; /* # of above */ Datum *newvals; /* vals of above */ + bool *newnulls; /* null flags for above */ char **args; /* arguments */ char *relname; /* triggered relation name */ Relation rel; /* triggered relation */ @@ -64,6 +66,7 @@ autoinc(PG_FUNCTION_ARGS) chattrs = (int *) palloc(nargs / 2 * sizeof(int)); newvals = (Datum *) palloc(nargs / 2 * sizeof(Datum)); + newnulls = (bool *) palloc(nargs / 2 * sizeof(bool)); for (i = 0; i < nargs;) { @@ -102,6 +105,7 @@ autoinc(PG_FUNCTION_ARGS) newvals[chnattrs] = DirectFunctionCall1(nextval, seqname); newvals[chnattrs] = Int32GetDatum((int32) DatumGetInt64(newvals[chnattrs])); } + newnulls[chnattrs] = false; pfree(DatumGetTextP(seqname)); chnattrs++; i++; @@ -109,16 +113,15 @@ autoinc(PG_FUNCTION_ARGS) if (chnattrs > 0) { - rettuple = SPI_modifytuple(rel, rettuple, chnattrs, chattrs, newvals, NULL); - if (rettuple == NULL) - /* internal error */ - elog(ERROR, "autoinc (%s): %d returned by SPI_modifytuple", - relname, SPI_result); + rettuple = heap_modify_tuple_by_cols(rettuple, tupdesc, + chnattrs, chattrs, + newvals, newnulls); } pfree(relname); pfree(chattrs); pfree(newvals); + pfree(newnulls); return PointerGetDatum(rettuple); } diff --git a/contrib/spi/insert_username.c b/contrib/spi/insert_username.c index 617c60a81c..a2e1747ff7 100644 --- a/contrib/spi/insert_username.c +++ b/contrib/spi/insert_username.c @@ -1,6 +1,4 @@ /* - * insert_username.c - * $Modified: Thu Oct 16 08:13:42 1997 by brook $ * contrib/spi/insert_username.c * * insert user name in response to a trigger @@ -8,6 +6,7 @@ */ #include "postgres.h" +#include "access/htup_details.h" #include "catalog/pg_type.h" #include "commands/trigger.h" #include "executor/spi.h" @@ -26,6 +25,7 @@ insert_username(PG_FUNCTION_ARGS) Trigger *trigger; /* to get trigger name */ int nargs; /* # of arguments */ Datum newval; /* new value of column */ + bool newnull; /* null flag */ char **args; /* arguments */ char *relname; /* triggered relation name */ Relation rel; /* triggered relation */ @@ -80,13 +80,11 @@ insert_username(PG_FUNCTION_ARGS) /* create fields containing name */ newval = CStringGetTextDatum(GetUserNameFromId(GetUserId(), false)); + newnull = false; /* construct new tuple */ - rettuple = SPI_modifytuple(rel, rettuple, 1, &attnum, &newval, NULL); - if (rettuple == NULL) - /* internal error */ - elog(ERROR, "insert_username (\"%s\"): %d returned by SPI_modifytuple", - relname, SPI_result); + rettuple = heap_modify_tuple_by_cols(rettuple, tupdesc, + 1, &attnum, &newval, &newnull); pfree(relname); diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c index cd700fe6d1..2d1f22c4e1 100644 --- a/contrib/spi/moddatetime.c +++ b/contrib/spi/moddatetime.c @@ -15,6 +15,7 @@ OH, me, I'm Terry Mackintosh */ #include "postgres.h" +#include "access/htup_details.h" #include "catalog/pg_type.h" #include "executor/spi.h" #include "commands/trigger.h" @@ -34,6 +35,7 @@ moddatetime(PG_FUNCTION_ARGS) int attnum; /* positional number of field to change */ Oid atttypid; /* type OID of field to change */ Datum newdt; /* The current datetime. */ + bool newdtnull; /* null flag for it */ char **args; /* arguments */ char *relname; /* triggered relation name */ Relation rel; /* triggered relation */ @@ -115,22 +117,13 @@ moddatetime(PG_FUNCTION_ARGS) args[0], relname))); newdt = (Datum) 0; /* keep compiler quiet */ } + newdtnull = false; -/* 1 is the number of items in the arrays attnum and newdt. - attnum is the positional number of the field to be updated. - newdt is the new datetime stamp. - NOTE that attnum and newdt are not arrays, but then a 1 element array - is not an array any more then they are. Thus, they can be considered a - one element array. -*/ - rettuple = SPI_modifytuple(rel, rettuple, 1, &attnum, &newdt, NULL); - - if (rettuple == NULL) - /* internal error */ - elog(ERROR, "moddatetime (%s): %d returned by SPI_modifytuple", - relname, SPI_result); + /* Replace the attnum'th column with newdt */ + rettuple = heap_modify_tuple_by_cols(rettuple, tupdesc, + 1, &attnum, &newdt, &newdtnull); -/* Clean up */ + /* Clean up */ pfree(relname); return PointerGetDatum(rettuple); diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c index 30dcfd4d3e..2733aa231e 100644 --- a/contrib/spi/timetravel.c +++ b/contrib/spi/timetravel.c @@ -11,6 +11,7 @@ #include +#include "access/htup_details.h" #include "catalog/pg_type.h" #include "commands/trigger.h" #include "executor/spi.h" @@ -183,13 +184,13 @@ timetravel(PG_FUNCTION_ARGS) int chnattrs = 0; int chattrs[MaxAttrNum]; Datum newvals[MaxAttrNum]; - char newnulls[MaxAttrNum]; + bool newnulls[MaxAttrNum]; oldtimeon = SPI_getbinval(trigtuple, tupdesc, attnum[a_time_on], &isnull); if (isnull) { newvals[chnattrs] = GetCurrentAbsoluteTime(); - newnulls[chnattrs] = ' '; + newnulls[chnattrs] = false; chattrs[chnattrs] = attnum[a_time_on]; chnattrs++; } @@ -201,7 +202,7 @@ timetravel(PG_FUNCTION_ARGS) (chnattrs > 0 && DatumGetInt32(newvals[a_time_on]) >= NOEND_ABSTIME)) elog(ERROR, "timetravel (%s): %s is infinity", relname, args[a_time_on]); newvals[chnattrs] = NOEND_ABSTIME; - newnulls[chnattrs] = ' '; + newnulls[chnattrs] = false; chattrs[chnattrs] = attnum[a_time_off]; chnattrs++; } @@ -220,21 +221,23 @@ timetravel(PG_FUNCTION_ARGS) { /* clear update_user value */ newvals[chnattrs] = nulltext; - newnulls[chnattrs] = 'n'; + newnulls[chnattrs] = true; chattrs[chnattrs] = attnum[a_upd_user]; chnattrs++; /* clear delete_user value */ newvals[chnattrs] = nulltext; - newnulls[chnattrs] = 'n'; + newnulls[chnattrs] = true; chattrs[chnattrs] = attnum[a_del_user]; chnattrs++; /* set insert_user value */ newvals[chnattrs] = newuser; - newnulls[chnattrs] = ' '; + newnulls[chnattrs] = false; chattrs[chnattrs] = attnum[a_ins_user]; chnattrs++; } - rettuple = SPI_modifytuple(rel, trigtuple, chnattrs, chattrs, newvals, newnulls); + rettuple = heap_modify_tuple_by_cols(trigtuple, tupdesc, + chnattrs, chattrs, + newvals, newnulls); return PointerGetDatum(rettuple); /* end of INSERT */ } @@ -395,13 +398,11 @@ timetravel(PG_FUNCTION_ARGS) chnattrs++; } - rettuple = SPI_modifytuple(rel, newtuple, chnattrs, chattrs, newvals, newnulls); - /* - * SPI_copytuple allocates tmptuple in upper executor context - have - * to free allocation using SPI_pfree + * Use SPI_modifytuple() here because we are inside SPI environment + * but rettuple must be allocated in caller's context. */ - /* SPI_pfree(tmptuple); */ + rettuple = SPI_modifytuple(rel, newtuple, chnattrs, chattrs, newvals, newnulls); } else /* DELETE case */ diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 817a5d0120..39133c9038 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -3382,8 +3382,9 @@ char * SPI_getnspname(Relation rel) repalloc, or SPI utility functions (except for SPI_copytuple, SPI_returntuple, - SPI_modifytuple, and - SPI_palloc) are made in this context. When a + SPI_modifytuple, + SPI_palloc, and + SPI_datumTransfer) are made in this context. When a procedure disconnects from the SPI manager (via SPI_finish) the current context is restored to the upper executor context, and all allocations made in the diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index 6d0f3f3767..e27ec78b71 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -846,6 +846,72 @@ heap_modify_tuple(HeapTuple tuple, return newTuple; } +/* + * heap_modify_tuple_by_cols + * form a new tuple from an old tuple and a set of replacement values. + * + * This is like heap_modify_tuple, except that instead of specifying which + * column(s) to replace by a boolean map, an array of target column numbers + * is used. This is often more convenient when a fixed number of columns + * are to be replaced. The replCols, replValues, and replIsnull arrays must + * be of length nCols. Target column numbers are indexed from 1. + * + * The result is allocated in the current memory context. + */ +HeapTuple +heap_modify_tuple_by_cols(HeapTuple tuple, + TupleDesc tupleDesc, + int nCols, + int *replCols, + Datum *replValues, + bool *replIsnull) +{ + int numberOfAttributes = tupleDesc->natts; + Datum *values; + bool *isnull; + HeapTuple newTuple; + int i; + + /* + * allocate and fill values and isnull arrays from the tuple, then replace + * selected columns from the input arrays. + */ + values = (Datum *) palloc(numberOfAttributes * sizeof(Datum)); + isnull = (bool *) palloc(numberOfAttributes * sizeof(bool)); + + heap_deform_tuple(tuple, tupleDesc, values, isnull); + + for (i = 0; i < nCols; i++) + { + int attnum = replCols[i]; + + if (attnum <= 0 || attnum > numberOfAttributes) + elog(ERROR, "invalid column number %d", attnum); + values[attnum - 1] = replValues[i]; + isnull[attnum - 1] = replIsnull[i]; + } + + /* + * create a new tuple from the values and isnull arrays + */ + newTuple = heap_form_tuple(tupleDesc, values, isnull); + + pfree(values); + pfree(isnull); + + /* + * copy the identification info of the old tuple: t_ctid, t_self, and OID + * (if any) + */ + newTuple->t_data->t_ctid = tuple->t_data->t_ctid; + newTuple->t_self = tuple->t_self; + newTuple->t_tableOid = tuple->t_tableOid; + if (tupleDesc->tdhasoid) + HeapTupleSetOid(newTuple, HeapTupleGetOid(tuple)); + + return newTuple; +} + /* * heap_deform_tuple * Given a tuple, extract data into values/isnull arrays; this is diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index 0e9ae5ff9c..c9d5060f2c 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -2329,8 +2329,10 @@ tsvector_update_trigger(PG_FUNCTION_ARGS, bool config_column) if (prs.curwords) { datum = PointerGetDatum(make_tsvector(&prs)); - rettuple = SPI_modifytuple(rel, rettuple, 1, &tsvector_attr_num, - &datum, NULL); + isnull = false; + rettuple = heap_modify_tuple_by_cols(rettuple, rel->rd_att, + 1, &tsvector_attr_num, + &datum, &isnull); pfree(DatumGetPointer(datum)); } else @@ -2340,14 +2342,12 @@ tsvector_update_trigger(PG_FUNCTION_ARGS, bool config_column) SET_VARSIZE(out, CALCDATASIZE(0, 0)); out->size = 0; datum = PointerGetDatum(out); - rettuple = SPI_modifytuple(rel, rettuple, 1, &tsvector_attr_num, - &datum, NULL); + isnull = false; + rettuple = heap_modify_tuple_by_cols(rettuple, rel->rd_att, + 1, &tsvector_attr_num, + &datum, &isnull); pfree(prs.words); } - if (rettuple == NULL) /* internal error */ - elog(ERROR, "tsvector_update_trigger: %d returned by SPI_modifytuple", - SPI_result); - return PointerGetDatum(rettuple); } diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h index d7e5fad11e..8fb1f6ddea 100644 --- a/src/include/access/htup_details.h +++ b/src/include/access/htup_details.h @@ -805,6 +805,12 @@ extern HeapTuple heap_modify_tuple(HeapTuple tuple, Datum *replValues, bool *replIsnull, bool *doReplace); +extern HeapTuple heap_modify_tuple_by_cols(HeapTuple tuple, + TupleDesc tupleDesc, + int nCols, + int *replCols, + Datum *replValues, + bool *replIsnull); extern void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull); extern void heap_freetuple(HeapTuple htup); diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 042b31fd77..91e1f8dd3f 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -4562,10 +4562,9 @@ exec_assign_value(PLpgSQL_execstate *estate, PLpgSQL_rec *rec; int fno; HeapTuple newtup; - int natts; - Datum *values; - bool *nulls; - bool *replaces; + int colnums[1]; + Datum values[1]; + bool nulls[1]; Oid atttype; int32 atttypmod; @@ -4584,9 +4583,8 @@ exec_assign_value(PLpgSQL_execstate *estate, errdetail("The tuple structure of a not-yet-assigned record is indeterminate."))); /* - * Get the number of the records field to change and the - * number of attributes in the tuple. Note: disallow system - * column names because the code below won't cope. + * Get the number of the record field to change. Disallow + * system columns because the code below won't cope. */ fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno <= 0) @@ -4594,42 +4592,25 @@ exec_assign_value(PLpgSQL_execstate *estate, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("record \"%s\" has no field \"%s\"", rec->refname, recfield->fieldname))); - fno--; - natts = rec->tupdesc->natts; - - /* - * Set up values/control arrays for heap_modify_tuple. For all - * the attributes except the one we want to replace, use the - * value that's in the old tuple. - */ - values = eval_mcontext_alloc(estate, sizeof(Datum) * natts); - nulls = eval_mcontext_alloc(estate, sizeof(bool) * natts); - replaces = eval_mcontext_alloc(estate, sizeof(bool) * natts); - - memset(replaces, false, sizeof(bool) * natts); - replaces[fno] = true; + colnums[0] = fno; /* * Now insert the new value, being careful to cast it to the * right type. */ - atttype = rec->tupdesc->attrs[fno]->atttypid; - atttypmod = rec->tupdesc->attrs[fno]->atttypmod; - values[fno] = exec_cast_value(estate, - value, - &isNull, - valtype, - valtypmod, - atttype, - atttypmod); - nulls[fno] = isNull; - - /* - * Now call heap_modify_tuple() to create a new tuple that - * replaces the old one in the record. - */ - newtup = heap_modify_tuple(rec->tup, rec->tupdesc, - values, nulls, replaces); + atttype = rec->tupdesc->attrs[fno - 1]->atttypid; + atttypmod = rec->tupdesc->attrs[fno - 1]->atttypmod; + values[0] = exec_cast_value(estate, + value, + &isNull, + valtype, + valtypmod, + atttype, + atttypmod); + nulls[0] = isNull; + + newtup = heap_modify_tuple_by_cols(rec->tup, rec->tupdesc, + 1, colnums, values, nulls); if (rec->freetup) heap_freetuple(rec->tup); diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c index 119a59ab07..32703fcdcf 100644 --- a/src/test/regress/regress.c +++ b/src/test/regress/regress.c @@ -639,15 +639,8 @@ ttdummy(PG_FUNCTION_ARGS) /* Tuple to return to upper Executor ... */ if (newtuple) /* UPDATE */ - { - HeapTuple tmptuple; - - tmptuple = SPI_copytuple(trigtuple); - rettuple = SPI_modifytuple(rel, tmptuple, 1, &(attnum[1]), &newoff, NULL); - SPI_freetuple(tmptuple); - } - else - /* DELETE */ + rettuple = SPI_modifytuple(rel, trigtuple, 1, &(attnum[1]), &newoff, NULL); + else /* DELETE */ rettuple = trigtuple; SPI_finish(); /* don't forget say Bye to SPI mgr */ -- cgit v1.2.3 From 352a24a1f9d6f7d4abb1175bfd22acc358f43140 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 28 Dec 2016 12:00:00 -0500 Subject: Generate fmgr prototypes automatically Gen_fmgrtab.pl creates a new file fmgrprotos.h, which contains prototypes for all functions registered in pg_proc.h. This avoids having to manually maintain these prototypes across a random variety of header files. It also automatically enforces a correct function signature, and since there are warnings about missing prototypes, it will detect functions that are defined but not registered in pg_proc.h (or otherwise used). Reviewed-by: Pavel Stehule --- contrib/btree_gist/btree_bit.c | 1 + contrib/btree_gist/btree_bytea.c | 1 + contrib/btree_gist/btree_date.c | 1 + contrib/btree_gist/btree_interval.c | 1 + contrib/btree_gist/btree_time.c | 1 + contrib/intarray/_int_selfuncs.c | 1 + contrib/lo/lo.c | 2 +- contrib/spi/moddatetime.c | 2 +- src/backend/Makefile | 15 +- src/backend/access/brin/brin.c | 1 + src/backend/access/brin/brin_inclusion.c | 5 +- src/backend/access/brin/brin_minmax.c | 5 +- src/backend/access/gin/ginfast.c | 1 + src/backend/access/gist/gist.c | 1 + src/backend/access/hash/hash.c | 1 + src/backend/access/hash/hashfunc.c | 10 + src/backend/access/index/amapi.c | 1 + src/backend/access/nbtree/nbtree.c | 1 + src/backend/access/spgist/spgutils.c | 1 + src/backend/access/transam/xlogfuncs.c | 1 - src/backend/catalog/namespace.c | 16 - src/backend/catalog/pg_proc.c | 4 - src/backend/commands/define.c | 2 +- src/backend/executor/nodeSamplescan.c | 1 + src/backend/foreign/foreign.c | 4 - src/backend/storage/smgr/smgrtype.c | 1 + src/backend/tsearch/dict_ispell.c | 1 + src/backend/tsearch/dict_simple.c | 1 + src/backend/tsearch/dict_synonym.c | 1 + src/backend/tsearch/ts_selfuncs.c | 1 + src/backend/utils/.gitignore | 1 + src/backend/utils/Gen_fmgrtab.pl | 35 +- src/backend/utils/Makefile | 12 +- src/backend/utils/adt/array_selfuncs.c | 1 + src/backend/utils/adt/array_typanalyze.c | 1 + src/backend/utils/adt/ascii.c | 1 + src/backend/utils/adt/geo_selfuncs.c | 1 + src/backend/utils/adt/jsonb_op.c | 1 + src/backend/utils/adt/network_gist.c | 1 + src/backend/utils/adt/network_selfuncs.c | 1 + src/backend/utils/adt/network_spgist.c | 1 + src/backend/utils/adt/numeric.c | 6 +- src/backend/utils/adt/pg_upgrade_support.c | 12 - src/backend/utils/adt/pgstatfuncs.c | 100 --- src/backend/utils/adt/rangetypes_spgist.c | 7 - src/backend/utils/adt/tsgistidx.c | 1 + src/backend/utils/adt/tsquery_gist.c | 1 + src/backend/utils/adt/tsquery_op.c | 1 + src/backend/utils/adt/tsrank.c | 1 + src/backend/utils/adt/tsvector.c | 1 + src/backend/utils/adt/varbit.c | 1 + src/include/Makefile | 3 +- src/include/access/amapi.h | 2 - src/include/access/brin.h | 6 - src/include/access/gin_private.h | 4 - src/include/access/gist_private.h | 1 - src/include/access/hash.h | 22 - src/include/access/nbtree.h | 1 - src/include/access/spgist.h | 1 - src/include/access/xlog_fn.h | 37 - src/include/catalog/pg_proc.h | 1 + src/include/commands/async.h | 5 - src/include/commands/sequence.h | 8 - src/include/commands/trigger.h | 2 - src/include/libpq/be-fsstubs.h | 31 - src/include/replication/logicalfuncs.h | 7 - src/include/replication/origin.h | 14 - src/include/replication/slot.h | 6 - src/include/replication/walreceiver.h | 1 - src/include/replication/walsender.h | 2 - src/include/storage/smgr.h | 6 - src/include/tsearch/ts_type.h | 89 --- src/include/tsearch/ts_utils.h | 117 --- src/include/utils/.gitignore | 1 + src/include/utils/acl.h | 14 - src/include/utils/array.h | 50 -- src/include/utils/ascii.h | 6 - src/include/utils/builtins.h | 1186 +--------------------------- src/include/utils/bytea.h | 25 - src/include/utils/cash.h | 48 -- src/include/utils/date.h | 113 --- src/include/utils/datetime.h | 3 - src/include/utils/formatting.h | 12 - src/include/utils/geo_decls.h | 262 +----- src/include/utils/inet.h | 27 - src/include/utils/int8.h | 104 --- src/include/utils/json.h | 64 -- src/include/utils/jsonb.h | 67 -- src/include/utils/nabstime.h | 63 -- src/include/utils/pg_lsn.h | 16 - src/include/utils/rangetypes.h | 80 -- src/include/utils/selfuncs.h | 28 - src/include/utils/snapmgr.h | 1 - src/include/utils/timestamp.h | 125 --- src/include/utils/varbit.h | 46 -- src/include/utils/xml.h | 33 - src/tools/msvc/Solution.pm | 10 +- src/tools/msvc/clean.bat | 2 + 98 files changed, 125 insertions(+), 2899 deletions(-) delete mode 100644 src/include/access/xlog_fn.h (limited to 'contrib/spi/moddatetime.c') diff --git a/contrib/btree_gist/btree_bit.c b/contrib/btree_gist/btree_bit.c index af210439f0..f34fa87f9d 100644 --- a/contrib/btree_gist/btree_bit.c +++ b/contrib/btree_gist/btree_bit.c @@ -5,6 +5,7 @@ #include "btree_gist.h" #include "btree_utils_var.h" +#include "utils/builtins.h" #include "utils/bytea.h" #include "utils/varbit.h" diff --git a/contrib/btree_gist/btree_bytea.c b/contrib/btree_gist/btree_bytea.c index dfc25a45c6..df6c960ce5 100644 --- a/contrib/btree_gist/btree_bytea.c +++ b/contrib/btree_gist/btree_bytea.c @@ -5,6 +5,7 @@ #include "btree_gist.h" #include "btree_utils_var.h" +#include "utils/builtins.h" #include "utils/bytea.h" diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index bb516a9500..56031d4a76 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -5,6 +5,7 @@ #include "btree_gist.h" #include "btree_utils_num.h" +#include "utils/builtins.h" #include "utils/date.h" typedef struct diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index acccb8b42e..e5cd0a281d 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -5,6 +5,7 @@ #include "btree_gist.h" #include "btree_utils_num.h" +#include "utils/builtins.h" #include "utils/timestamp.h" typedef struct diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index 41d9959214..27f30bc112 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -5,6 +5,7 @@ #include "btree_gist.h" #include "btree_utils_num.h" +#include "utils/builtins.h" #include "utils/date.h" #include "utils/timestamp.h" diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c index bdc8a8d007..9b4a22fe34 100644 --- a/contrib/intarray/_int_selfuncs.c +++ b/contrib/intarray/_int_selfuncs.c @@ -19,6 +19,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_type.h" +#include "utils/builtins.h" #include "utils/selfuncs.h" #include "utils/syscache.h" #include "utils/lsyscache.h" diff --git a/contrib/lo/lo.c b/contrib/lo/lo.c index 85e67130bb..050bd8a72a 100644 --- a/contrib/lo/lo.c +++ b/contrib/lo/lo.c @@ -9,7 +9,7 @@ #include "commands/trigger.h" #include "executor/spi.h" -#include "libpq/be-fsstubs.h" +#include "utils/builtins.h" #include "utils/rel.h" PG_MODULE_MAGIC; diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c index 2d1f22c4e1..70476f77c2 100644 --- a/contrib/spi/moddatetime.c +++ b/contrib/spi/moddatetime.c @@ -19,8 +19,8 @@ OH, me, I'm Terry Mackintosh #include "catalog/pg_type.h" #include "executor/spi.h" #include "commands/trigger.h" +#include "utils/builtins.h" #include "utils/rel.h" -#include "utils/timestamp.h" PG_MODULE_MAGIC; diff --git a/src/backend/Makefile b/src/backend/Makefile index 7ce25d3ebb..82975f514a 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -139,8 +139,8 @@ storage/lmgr/lwlocknames.h: storage/lmgr/generate-lwlocknames.pl storage/lmgr/lw utils/errcodes.h: utils/generate-errcodes.pl utils/errcodes.txt $(MAKE) -C utils errcodes.h -utils/fmgroids.h: utils/Gen_fmgrtab.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h - $(MAKE) -C utils fmgroids.h +utils/fmgroids.h utils/fmgrprotos.h: utils/Gen_fmgrtab.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h + $(MAKE) -C utils $(notdir $@) utils/probes.h: utils/probes.d $(MAKE) -C utils probes.h @@ -166,7 +166,7 @@ submake-schemapg: .PHONY: generated-headers -generated-headers: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/catalog/schemapg.h $(top_builddir)/src/include/storage/lwlocknames.h $(top_builddir)/src/include/utils/errcodes.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/probes.h +generated-headers: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/catalog/schemapg.h $(top_builddir)/src/include/storage/lwlocknames.h $(top_builddir)/src/include/utils/errcodes.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/fmgrprotos.h $(top_builddir)/src/include/utils/probes.h $(top_builddir)/src/include/parser/gram.h: parser/gram.h prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \ @@ -193,6 +193,11 @@ $(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h cd '$(dir $@)' && rm -f $(notdir $@) && \ $(LN_S) "$$prereqdir/$(notdir $<)" . +$(top_builddir)/src/include/utils/fmgrprotos.h: utils/fmgrprotos.h + prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \ + cd '$(dir $@)' && rm -f $(notdir $@) && \ + $(LN_S) "$$prereqdir/$(notdir $<)" . + $(top_builddir)/src/include/utils/probes.h: utils/probes.h cd '$(dir $@)' && rm -f $(notdir $@) && \ $(LN_S) "../../../$(subdir)/utils/probes.h" . @@ -211,7 +216,7 @@ distprep: $(MAKE) -C catalog schemapg.h postgres.bki postgres.description postgres.shdescription $(MAKE) -C replication repl_gram.c repl_scanner.c syncrep_gram.c syncrep_scanner.c $(MAKE) -C storage/lmgr lwlocknames.h - $(MAKE) -C utils fmgrtab.c fmgroids.h errcodes.h + $(MAKE) -C utils fmgrtab.c fmgroids.h fmgrprotos.h errcodes.h $(MAKE) -C utils/misc guc-file.c $(MAKE) -C utils/sort qsort_tuple.c @@ -303,6 +308,7 @@ clean: $(top_builddir)/src/include/catalog/schemapg.h \ $(top_builddir)/src/include/storage/lwlocknames.h \ $(top_builddir)/src/include/utils/fmgroids.h \ + $(top_builddir)/src/include/utils/fmgrprotos.h \ $(top_builddir)/src/include/utils/probes.h ifeq ($(PORTNAME), cygwin) rm -f postgres.dll libpostgres.a @@ -331,6 +337,7 @@ maintainer-clean: distclean storage/lmgr/lwlocknames.c \ storage/lmgr/lwlocknames.h \ utils/fmgroids.h \ + utils/fmgrprotos.h \ utils/fmgrtab.c \ utils/errcodes.h \ utils/misc/guc-file.c \ diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index 3fce672ca9..d60ddd242c 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -28,6 +28,7 @@ #include "pgstat.h" #include "storage/bufmgr.h" #include "storage/freespace.h" +#include "utils/builtins.h" #include "utils/index_selfuncs.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/access/brin/brin_inclusion.c b/src/backend/access/brin/brin_inclusion.c index eb123c83fc..bc16dd7981 100644 --- a/src/backend/access/brin/brin_inclusion.c +++ b/src/backend/access/brin/brin_inclusion.c @@ -30,6 +30,7 @@ #include "access/skey.h" #include "catalog/pg_amop.h" #include "catalog/pg_type.h" +#include "utils/builtins.h" #include "utils/datum.h" #include "utils/lsyscache.h" #include "utils/rel.h" @@ -76,10 +77,6 @@ typedef struct InclusionOpaque FmgrInfo strategy_procinfos[RTMaxStrategyNumber]; } InclusionOpaque; -Datum brin_inclusion_opcinfo(PG_FUNCTION_ARGS); -Datum brin_inclusion_add_value(PG_FUNCTION_ARGS); -Datum brin_inclusion_consistent(PG_FUNCTION_ARGS); -Datum brin_inclusion_union(PG_FUNCTION_ARGS); static FmgrInfo *inclusion_get_procinfo(BrinDesc *bdesc, uint16 attno, uint16 procnum); static FmgrInfo *inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, diff --git a/src/backend/access/brin/brin_minmax.c b/src/backend/access/brin/brin_minmax.c index ebbc789a34..8f7a0c75b8 100644 --- a/src/backend/access/brin/brin_minmax.c +++ b/src/backend/access/brin/brin_minmax.c @@ -16,6 +16,7 @@ #include "access/stratnum.h" #include "catalog/pg_type.h" #include "catalog/pg_amop.h" +#include "utils/builtins.h" #include "utils/datum.h" #include "utils/lsyscache.h" #include "utils/rel.h" @@ -28,10 +29,6 @@ typedef struct MinmaxOpaque FmgrInfo strategy_procinfos[BTMaxStrategyNumber]; } MinmaxOpaque; -Datum brin_minmax_opcinfo(PG_FUNCTION_ARGS); -Datum brin_minmax_add_value(PG_FUNCTION_ARGS); -Datum brin_minmax_consistent(PG_FUNCTION_ARGS); -Datum brin_minmax_union(PG_FUNCTION_ARGS); static FmgrInfo *minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, uint16 strategynum); diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 5f2f1e5b9f..85031e2921 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -30,6 +30,7 @@ #include "postmaster/autovacuum.h" #include "storage/indexfsm.h" #include "storage/lmgr.h" +#include "utils/builtins.h" /* GUC parameter */ int gin_pending_list_limit = 0; diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 4092a8b258..597056ae44 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -18,6 +18,7 @@ #include "access/gistscan.h" #include "catalog/pg_collation.h" #include "miscadmin.h" +#include "utils/builtins.h" #include "utils/index_selfuncs.h" #include "utils/memutils.h" #include "utils/rel.h" diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 0cbf6b07be..a64a9b9696 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -25,6 +25,7 @@ #include "commands/vacuum.h" #include "miscadmin.h" #include "optimizer/plancat.h" +#include "utils/builtins.h" #include "utils/index_selfuncs.h" #include "utils/rel.h" diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index ef09afb400..289d766419 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -27,7 +27,17 @@ #include "postgres.h" #include "access/hash.h" +#include "utils/builtins.h" +/* + * Datatype-specific hash functions. + * + * These support both hash indexes and hash joins. + * + * NOTE: some of these are also used by catcache operations, without + * any direct connection to hash indexes. Also, the common hash_any + * routine is also used by dynahash tables. + */ /* Note: this is used for both "char" and boolean datatypes */ Datum diff --git a/src/backend/access/index/amapi.c b/src/backend/access/index/amapi.c index 5b55353b2c..7b597a072f 100644 --- a/src/backend/access/index/amapi.c +++ b/src/backend/access/index/amapi.c @@ -17,6 +17,7 @@ #include "access/htup_details.h" #include "catalog/pg_am.h" #include "catalog/pg_opclass.h" +#include "utils/builtins.h" #include "utils/syscache.h" diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index c6eed63d91..1bb1acfea6 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -28,6 +28,7 @@ #include "storage/lmgr.h" #include "storage/smgr.h" #include "tcop/tcopprot.h" /* pgrminclude ignore */ +#include "utils/builtins.h" #include "utils/index_selfuncs.h" #include "utils/memutils.h" diff --git a/src/backend/access/spgist/spgutils.c b/src/backend/access/spgist/spgutils.c index b9e4940c95..ca4b0bdbe4 100644 --- a/src/backend/access/spgist/spgutils.c +++ b/src/backend/access/spgist/spgutils.c @@ -22,6 +22,7 @@ #include "storage/bufmgr.h" #include "storage/indexfsm.h" #include "storage/lmgr.h" +#include "utils/builtins.h" #include "utils/index_selfuncs.h" #include "utils/lsyscache.h" diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 5cafb8b913..63e6552ce7 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -18,7 +18,6 @@ #include "access/htup_details.h" #include "access/xlog.h" -#include "access/xlog_fn.h" #include "access/xlog_internal.h" #include "access/xlogutils.h" #include "catalog/catalog.h" diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index c9473c8917..77e9777a23 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -198,22 +198,6 @@ static void NamespaceCallback(Datum arg, int cacheid, uint32 hashvalue); static bool MatchNamedCall(HeapTuple proctup, int nargs, List *argnames, int **argnumbers); -/* These don't really need to appear in any header file */ -Datum pg_table_is_visible(PG_FUNCTION_ARGS); -Datum pg_type_is_visible(PG_FUNCTION_ARGS); -Datum pg_function_is_visible(PG_FUNCTION_ARGS); -Datum pg_operator_is_visible(PG_FUNCTION_ARGS); -Datum pg_opclass_is_visible(PG_FUNCTION_ARGS); -Datum pg_opfamily_is_visible(PG_FUNCTION_ARGS); -Datum pg_collation_is_visible(PG_FUNCTION_ARGS); -Datum pg_conversion_is_visible(PG_FUNCTION_ARGS); -Datum pg_ts_parser_is_visible(PG_FUNCTION_ARGS); -Datum pg_ts_dict_is_visible(PG_FUNCTION_ARGS); -Datum pg_ts_template_is_visible(PG_FUNCTION_ARGS); -Datum pg_ts_config_is_visible(PG_FUNCTION_ARGS); -Datum pg_my_temp_schema(PG_FUNCTION_ARGS); -Datum pg_is_other_temp_schema(PG_FUNCTION_ARGS); - /* * RangeVarGetRelid diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c index 85cec0cb1c..05d91fa859 100644 --- a/src/backend/catalog/pg_proc.c +++ b/src/backend/catalog/pg_proc.c @@ -41,10 +41,6 @@ #include "utils/syscache.h" -Datum fmgr_internal_validator(PG_FUNCTION_ARGS); -Datum fmgr_c_validator(PG_FUNCTION_ARGS); -Datum fmgr_sql_validator(PG_FUNCTION_ARGS); - typedef struct { char *proname; diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c index b75dcff5d0..714b5252c7 100644 --- a/src/backend/commands/define.c +++ b/src/backend/commands/define.c @@ -40,7 +40,7 @@ #include "nodes/makefuncs.h" #include "parser/parse_type.h" #include "parser/scansup.h" -#include "utils/int8.h" +#include "utils/builtins.h" /* * Extract a string value (otherwise uninterpreted) from a DefElem. diff --git a/src/backend/executor/nodeSamplescan.c b/src/backend/executor/nodeSamplescan.c index 9c686a045b..8db5469d5a 100644 --- a/src/backend/executor/nodeSamplescan.c +++ b/src/backend/executor/nodeSamplescan.c @@ -22,6 +22,7 @@ #include "miscadmin.h" #include "pgstat.h" #include "storage/predicate.h" +#include "utils/builtins.h" #include "utils/rel.h" #include "utils/tqual.h" diff --git a/src/backend/foreign/foreign.c b/src/backend/foreign/foreign.c index 291c8a3bf4..fdb4f71253 100644 --- a/src/backend/foreign/foreign.c +++ b/src/backend/foreign/foreign.c @@ -28,10 +28,6 @@ #include "utils/syscache.h" -extern Datum pg_options_to_table(PG_FUNCTION_ARGS); -extern Datum postgresql_fdw_validator(PG_FUNCTION_ARGS); - - /* * GetForeignDataWrapper - look up the foreign-data wrapper by OID. */ diff --git a/src/backend/storage/smgr/smgrtype.c b/src/backend/storage/smgr/smgrtype.c index d74feb58eb..dc81fe81cf 100644 --- a/src/backend/storage/smgr/smgrtype.c +++ b/src/backend/storage/smgr/smgrtype.c @@ -15,6 +15,7 @@ #include "postgres.h" #include "storage/smgr.h" +#include "utils/builtins.h" typedef struct smgrid diff --git a/src/backend/tsearch/dict_ispell.c b/src/backend/tsearch/dict_ispell.c index eca723fb07..b4576bf1f8 100644 --- a/src/backend/tsearch/dict_ispell.c +++ b/src/backend/tsearch/dict_ispell.c @@ -17,6 +17,7 @@ #include "tsearch/dicts/spell.h" #include "tsearch/ts_locale.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" typedef struct diff --git a/src/backend/tsearch/dict_simple.c b/src/backend/tsearch/dict_simple.c index 494594cbca..c361362880 100644 --- a/src/backend/tsearch/dict_simple.c +++ b/src/backend/tsearch/dict_simple.c @@ -16,6 +16,7 @@ #include "commands/defrem.h" #include "tsearch/ts_locale.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" typedef struct diff --git a/src/backend/tsearch/dict_synonym.c b/src/backend/tsearch/dict_synonym.c index 3fd6fa579a..e67d2e6e04 100644 --- a/src/backend/tsearch/dict_synonym.c +++ b/src/backend/tsearch/dict_synonym.c @@ -16,6 +16,7 @@ #include "commands/defrem.h" #include "tsearch/ts_locale.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" typedef struct { diff --git a/src/backend/tsearch/ts_selfuncs.c b/src/backend/tsearch/ts_selfuncs.c index 9fce7c3eba..904d8848c8 100644 --- a/src/backend/tsearch/ts_selfuncs.c +++ b/src/backend/tsearch/ts_selfuncs.c @@ -19,6 +19,7 @@ #include "miscadmin.h" #include "nodes/nodes.h" #include "tsearch/ts_type.h" +#include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/selfuncs.h" #include "utils/syscache.h" diff --git a/src/backend/utils/.gitignore b/src/backend/utils/.gitignore index 5c3a565ba0..f26215c631 100644 --- a/src/backend/utils/.gitignore +++ b/src/backend/utils/.gitignore @@ -1,4 +1,5 @@ /fmgrtab.c /fmgroids.h +/fmgrprotos.h /probes.h /errcodes.h diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl index bc5865a14b..cdd603ab6f 100644 --- a/src/backend/utils/Gen_fmgrtab.pl +++ b/src/backend/utils/Gen_fmgrtab.pl @@ -87,9 +87,11 @@ foreach my $row (@$data) # Emit headers for both files my $tmpext = ".tmp$$"; my $oidsfile = $output_path . 'fmgroids.h'; +my $protosfile = $output_path . 'fmgrprotos.h'; my $tabfile = $output_path . 'fmgrtab.c'; open H, '>', $oidsfile . $tmpext or die "Could not open $oidsfile$tmpext: $!"; +open P, '>', $protosfile . $tmpext or die "Could not open $protosfile$tmpext: $!"; open T, '>', $tabfile . $tmpext or die "Could not open $tabfile$tmpext: $!"; print H @@ -130,6 +132,33 @@ qq|/*------------------------------------------------------------------------- */ |; +print P +qq|/*------------------------------------------------------------------------- + * + * fmgrprotos.h + * Prototypes for built-in functions. + * + * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * NOTES + * ****************************** + * *** DO NOT EDIT THIS FILE! *** + * ****************************** + * + * It has been GENERATED by $0 + * from $infile + * + *------------------------------------------------------------------------- + */ + +#ifndef FMGRPROTOS_H +#define FMGRPROTOS_H + +#include "fmgr.h" + +|; + print T qq|/*------------------------------------------------------------------------- * @@ -154,6 +183,7 @@ qq|/*------------------------------------------------------------------------- #include "postgres.h" #include "utils/fmgrtab.h" +#include "utils/fmgrprotos.h" |; @@ -164,7 +194,7 @@ foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr) next if $seenit{ $s->{prosrc} }; $seenit{ $s->{prosrc} } = 1; print H "#define F_" . uc $s->{prosrc} . " $s->{oid}\n"; - print T "extern Datum $s->{prosrc} (PG_FUNCTION_ARGS);\n"; + print P "extern Datum $s->{prosrc}(PG_FUNCTION_ARGS);\n"; } # Create the fmgr_builtins table @@ -180,6 +210,7 @@ foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr) # And add the file footers. print H "\n#endif /* FMGROIDS_H */\n"; +print P "\n#endif /* FMGRPROTOS_H */\n"; print T qq| /* dummy entry is easier than getting rid of comma after last real one */ @@ -193,10 +224,12 @@ const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin)) - 1; |; close(H); +close(P); close(T); # Finally, rename the completed files into place. Catalog::RenameTempFile($oidsfile, $tmpext); +Catalog::RenameTempFile($protosfile, $tmpext); Catalog::RenameTempFile($tabfile, $tmpext); sub usage diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index 8374533718..4fa5ac26f7 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -16,12 +16,12 @@ catalogdir = $(top_srcdir)/src/backend/catalog include $(top_srcdir)/src/backend/common.mk -all: errcodes.h fmgroids.h probes.h +all: errcodes.h fmgroids.h fmgrprotos.h probes.h -$(SUBDIRS:%=%-recursive): fmgroids.h +$(SUBDIRS:%=%-recursive): fmgroids.h fmgrprotos.h # see explanation in ../parser/Makefile -fmgroids.h: fmgrtab.c ; +fmgroids.h fmgrprotos.h: fmgrtab.c ; fmgrtab.c: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h $(PERL) -I $(catalogdir) $< $(top_srcdir)/src/include/catalog/pg_proc.h @@ -43,10 +43,10 @@ else endif -# fmgroids.h, fmgrtab.c and errcodes.h are in the distribution tarball, so they -# are not cleaned here. +# fmgroids.h, fmgrprotos.h, fmgrtab.c and errcodes.h are in the +# distribution tarball, so they are not cleaned here. clean: rm -f probes.h maintainer-clean: clean - rm -f fmgroids.h fmgrtab.c errcodes.h + rm -f fmgroids.h fmgrprotos.h fmgrtab.c errcodes.h diff --git a/src/backend/utils/adt/array_selfuncs.c b/src/backend/utils/adt/array_selfuncs.c index c9ccc9a6a4..50e8145241 100644 --- a/src/backend/utils/adt/array_selfuncs.c +++ b/src/backend/utils/adt/array_selfuncs.c @@ -22,6 +22,7 @@ #include "catalog/pg_statistic.h" #include "optimizer/clauses.h" #include "utils/array.h" +#include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/selfuncs.h" #include "utils/typcache.h" diff --git a/src/backend/utils/adt/array_typanalyze.c b/src/backend/utils/adt/array_typanalyze.c index b2ddacd3d5..85b7a43292 100644 --- a/src/backend/utils/adt/array_typanalyze.c +++ b/src/backend/utils/adt/array_typanalyze.c @@ -18,6 +18,7 @@ #include "catalog/pg_collation.h" #include "commands/vacuum.h" #include "utils/array.h" +#include "utils/builtins.h" #include "utils/datum.h" #include "utils/lsyscache.h" #include "utils/typcache.h" diff --git a/src/backend/utils/adt/ascii.c b/src/backend/utils/adt/ascii.c index d4c4a3ec53..e219d4b495 100644 --- a/src/backend/utils/adt/ascii.c +++ b/src/backend/utils/adt/ascii.c @@ -13,6 +13,7 @@ #include "mb/pg_wchar.h" #include "utils/ascii.h" +#include "utils/builtins.h" static void pg_to_ascii(unsigned char *src, unsigned char *src_end, unsigned char *dest, int enc); diff --git a/src/backend/utils/adt/geo_selfuncs.c b/src/backend/utils/adt/geo_selfuncs.c index 39701d725b..774063e92c 100644 --- a/src/backend/utils/adt/geo_selfuncs.c +++ b/src/backend/utils/adt/geo_selfuncs.c @@ -18,6 +18,7 @@ */ #include "postgres.h" +#include "utils/builtins.h" #include "utils/geo_decls.h" diff --git a/src/backend/utils/adt/jsonb_op.c b/src/backend/utils/adt/jsonb_op.c index f9d6947362..d4c490e948 100644 --- a/src/backend/utils/adt/jsonb_op.c +++ b/src/backend/utils/adt/jsonb_op.c @@ -15,6 +15,7 @@ #include "catalog/pg_type.h" #include "miscadmin.h" +#include "utils/builtins.h" #include "utils/jsonb.h" Datum diff --git a/src/backend/utils/adt/network_gist.c b/src/backend/utils/adt/network_gist.c index e3af7341c6..a0097dae9c 100644 --- a/src/backend/utils/adt/network_gist.c +++ b/src/backend/utils/adt/network_gist.c @@ -49,6 +49,7 @@ #include "access/gist.h" #include "access/stratnum.h" +#include "utils/builtins.h" #include "utils/inet.h" /* diff --git a/src/backend/utils/adt/network_selfuncs.c b/src/backend/utils/adt/network_selfuncs.c index 1d30c4e30d..bcdd902ee8 100644 --- a/src/backend/utils/adt/network_selfuncs.c +++ b/src/backend/utils/adt/network_selfuncs.c @@ -23,6 +23,7 @@ #include "access/htup_details.h" #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" +#include "utils/builtins.h" #include "utils/inet.h" #include "utils/lsyscache.h" #include "utils/selfuncs.h" diff --git a/src/backend/utils/adt/network_spgist.c b/src/backend/utils/adt/network_spgist.c index d3c2068dd6..c48f45fe47 100644 --- a/src/backend/utils/adt/network_spgist.c +++ b/src/backend/utils/adt/network_spgist.c @@ -35,6 +35,7 @@ #include "access/spgist.h" #include "catalog/pg_type.h" +#include "utils/builtins.h" #include "utils/inet.h" diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 89b4e4d8b2..5cc8de5af2 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -3110,7 +3110,11 @@ numeric_float8(PG_FUNCTION_ARGS) } -/* Convert numeric to float8; if out of range, return +/- HUGE_VAL */ +/* + * Convert numeric to float8; if out of range, return +/- HUGE_VAL + * + * (internal helper function, not directly callable from SQL) + */ Datum numeric_float8_no_overflow(PG_FUNCTION_ARGS) { diff --git a/src/backend/utils/adt/pg_upgrade_support.c b/src/backend/utils/adt/pg_upgrade_support.c index 4e7620ded3..282b2649ff 100644 --- a/src/backend/utils/adt/pg_upgrade_support.c +++ b/src/backend/utils/adt/pg_upgrade_support.c @@ -20,18 +20,6 @@ #include "utils/builtins.h" -Datum binary_upgrade_set_next_pg_type_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_array_pg_type_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_toast_pg_type_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_heap_pg_class_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_index_pg_class_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_toast_pg_class_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_pg_enum_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_next_pg_authid_oid(PG_FUNCTION_ARGS); -Datum binary_upgrade_create_empty_extension(PG_FUNCTION_ARGS); -Datum binary_upgrade_set_record_init_privs(PG_FUNCTION_ARGS); - - #define CHECK_IS_BINARY_UPGRADE \ do { \ if (!IsBinaryUpgrade) \ diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index a380dbf737..a987d0d621 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -29,106 +29,6 @@ #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) -/* bogus ... these externs should be in a header file */ -extern Datum pg_stat_get_numscans(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_tuples_returned(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_tuples_fetched(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_tuples_inserted(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_tuples_updated(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_tuples_deleted(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_tuples_hot_updated(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_live_tuples(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_dead_tuples(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_mod_since_analyze(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_blocks_hit(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_last_vacuum_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_last_autovacuum_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_last_analyze_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_last_autoanalyze_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_vacuum_count(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_autovacuum_count(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_analyze_count(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_autoanalyze_count(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_function_calls(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_function_total_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_function_self_time(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_backend_idset(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_activity(PG_FUNCTION_ARGS); -extern Datum pg_backend_pid(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_pid(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_dbid(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_userid(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_activity(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_wait_event_type(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_wait_event(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_activity_start(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_xact_start(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_start(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_client_addr(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_backend_client_port(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_progress_info(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_db_numbackends(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_xact_commit(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_xact_rollback(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_blocks_fetched(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_blocks_hit(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_tuples_returned(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_tuples_fetched(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_tuples_inserted(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_tuples_updated(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_tuples_deleted(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_conflict_tablespace(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_conflict_lock(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_conflict_snapshot(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_conflict_bufferpin(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_conflict_startup_deadlock(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_conflict_all(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_deadlocks(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_stat_reset_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_temp_files(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_temp_bytes(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_blk_read_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_db_blk_write_time(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_archiver(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_bgwriter_timed_checkpoints(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_requested_checkpoints(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_checkpoint_write_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_checkpoint_sync_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_buf_written_checkpoints(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_buf_written_clean(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_maxwritten_clean(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_stat_reset_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_buf_written_backend(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_buf_fsync_backend(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_buf_alloc(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_xact_numscans(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_tuples_returned(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_tuples_fetched(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_tuples_inserted(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_tuples_updated(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_tuples_deleted(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_tuples_hot_updated(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_blocks_fetched(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_blocks_hit(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_xact_function_calls(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_function_total_time(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_xact_function_self_time(PG_FUNCTION_ARGS); - -extern Datum pg_stat_get_snapshot_timestamp(PG_FUNCTION_ARGS); -extern Datum pg_stat_clear_snapshot(PG_FUNCTION_ARGS); -extern Datum pg_stat_reset(PG_FUNCTION_ARGS); -extern Datum pg_stat_reset_shared(PG_FUNCTION_ARGS); -extern Datum pg_stat_reset_single_table_counters(PG_FUNCTION_ARGS); -extern Datum pg_stat_reset_single_function_counters(PG_FUNCTION_ARGS); - /* Global bgwriter statistics, from bgwriter.c */ extern PgStat_MsgBgWriter bgwriterStats; diff --git a/src/backend/utils/adt/rangetypes_spgist.c b/src/backend/utils/adt/rangetypes_spgist.c index 185b1db342..a887e55b92 100644 --- a/src/backend/utils/adt/rangetypes_spgist.c +++ b/src/backend/utils/adt/rangetypes_spgist.c @@ -43,13 +43,6 @@ #include "utils/datum.h" #include "utils/rangetypes.h" -/* SP-GiST API functions */ -Datum spg_range_quad_config(PG_FUNCTION_ARGS); -Datum spg_range_quad_choose(PG_FUNCTION_ARGS); -Datum spg_range_quad_picksplit(PG_FUNCTION_ARGS); -Datum spg_range_quad_inner_consistent(PG_FUNCTION_ARGS); -Datum spg_range_quad_leaf_consistent(PG_FUNCTION_ARGS); - static int16 getQuadrant(TypeCacheEntry *typcache, RangeType *centroid, RangeType *tst); static int bound_cmp(const void *a, const void *b, void *arg); diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index c86152375a..7ce2699b5c 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -17,6 +17,7 @@ #include "access/gist.h" #include "access/tuptoaster.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" #include "utils/pg_crc.h" diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c index e22f86496e..85518dc7d9 100644 --- a/src/backend/utils/adt/tsquery_gist.c +++ b/src/backend/utils/adt/tsquery_gist.c @@ -17,6 +17,7 @@ #include "access/stratnum.h" #include "access/gist.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" #define GETENTRY(vec,pos) DatumGetTSQuerySign((vec)->vector[pos].key) diff --git a/src/backend/utils/adt/tsquery_op.c b/src/backend/utils/adt/tsquery_op.c index 4e581adc26..755c3e9ee8 100644 --- a/src/backend/utils/adt/tsquery_op.c +++ b/src/backend/utils/adt/tsquery_op.c @@ -15,6 +15,7 @@ #include "postgres.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" Datum tsquery_numnode(PG_FUNCTION_ARGS) diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index 9826eb3143..9b2cd6df41 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -18,6 +18,7 @@ #include "tsearch/ts_utils.h" #include "utils/array.h" +#include "utils/builtins.h" #include "miscadmin.h" diff --git a/src/backend/utils/adt/tsvector.c b/src/backend/utils/adt/tsvector.c index ccd149fd6f..6f66c1f58c 100644 --- a/src/backend/utils/adt/tsvector.c +++ b/src/backend/utils/adt/tsvector.c @@ -17,6 +17,7 @@ #include "libpq/pqformat.h" #include "tsearch/ts_locale.h" #include "tsearch/ts_utils.h" +#include "utils/builtins.h" #include "utils/memutils.h" typedef struct diff --git a/src/backend/utils/adt/varbit.c b/src/backend/utils/adt/varbit.c index d53d65ab7d..af39d4cf25 100644 --- a/src/backend/utils/adt/varbit.c +++ b/src/backend/utils/adt/varbit.c @@ -20,6 +20,7 @@ #include "libpq/pqformat.h" #include "nodes/nodeFuncs.h" #include "utils/array.h" +#include "utils/builtins.h" #include "utils/varbit.h" #define HEXDIG(z) ((z)<10 ? ((z)+'0') : ((z)-10+'A')) diff --git a/src/include/Makefile b/src/include/Makefile index cad8951f97..8c6e888c62 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -45,6 +45,7 @@ install: all installdirs $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)' $(INSTALL_DATA) utils/errcodes.h '$(DESTDIR)$(includedir_server)/utils' $(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils' + $(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils' # We don't use INSTALL_DATA for performance reasons --- there are a lot of files cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ || exit; \ chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/*.h || exit; \ @@ -72,7 +73,7 @@ uninstall: clean: - rm -f utils/fmgroids.h utils/errcodes.h parser/gram.h utils/probes.h catalog/schemapg.h + rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h parser/gram.h utils/probes.h catalog/schemapg.h distclean maintainer-clean: clean rm -f pg_config.h pg_config_ext.h pg_config_os.h dynloader.h stamp-h stamp-ext-h diff --git a/src/include/access/amapi.h b/src/include/access/amapi.h index 48b0cc0449..6a5f279e7f 100644 --- a/src/include/access/amapi.h +++ b/src/include/access/amapi.h @@ -203,6 +203,4 @@ typedef struct IndexAmRoutine extern IndexAmRoutine *GetIndexAmRoutine(Oid amhandler); extern IndexAmRoutine *GetIndexAmRoutineByAmId(Oid amoid, bool noerror); -extern Datum amvalidate(PG_FUNCTION_ARGS); - #endif /* AMAPI_H */ diff --git a/src/include/access/brin.h b/src/include/access/brin.h index 4aed9778bb..896824a0cf 100644 --- a/src/include/access/brin.h +++ b/src/include/access/brin.h @@ -15,12 +15,6 @@ #include "utils/relcache.h" -/* - * prototypes for functions in brin.c (external entry points for BRIN) - */ -extern Datum brinhandler(PG_FUNCTION_ARGS); -extern Datum brin_summarize_new_values(PG_FUNCTION_ARGS); - /* * Storage type for BRIN's reloptions */ diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h index 0ff3275c2f..d46274ee85 100644 --- a/src/include/access/gin_private.h +++ b/src/include/access/gin_private.h @@ -591,7 +591,6 @@ typedef struct ginxlogDeleteListPages /* ginutil.c */ -extern Datum ginhandler(PG_FUNCTION_ARGS); extern bytea *ginoptions(Datum reloptions, bool validate); extern void initGinState(GinState *state, Relation index); extern Buffer GinNewBuffer(Relation index); @@ -880,9 +879,6 @@ extern void ginFreeScanKeys(GinScanOpaque so); /* ginget.c */ extern int64 gingetbitmap(IndexScanDesc scan, TIDBitmap *tbm); -/* ginfast.c */ -extern Datum gin_clean_pending_list(PG_FUNCTION_ARGS); - /* ginlogic.c */ extern void ginInitConsistentFunction(GinState *ginstate, GinScanKey key); diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index 72f52d44ba..60a770aa30 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -423,7 +423,6 @@ typedef struct GiSTOptions } GiSTOptions; /* gist.c */ -extern Datum gisthandler(PG_FUNCTION_ARGS); extern void gistbuildempty(Relation index); extern bool gistinsert(Relation r, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, diff --git a/src/include/access/hash.h b/src/include/access/hash.h index b0a11315a6..69a3873fac 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -258,7 +258,6 @@ typedef HashMetaPageData *HashMetaPage; /* public routines */ -extern Datum hashhandler(PG_FUNCTION_ARGS); extern IndexBuildResult *hashbuild(Relation heap, Relation index, struct IndexInfo *indexInfo); extern void hashbuildempty(Relation index); @@ -280,27 +279,6 @@ extern IndexBulkDeleteResult *hashvacuumcleanup(IndexVacuumInfo *info, extern bytea *hashoptions(Datum reloptions, bool validate); extern bool hashvalidate(Oid opclassoid); -/* - * Datatype-specific hash functions in hashfunc.c. - * - * These support both hash indexes and hash joins. - * - * NOTE: some of these are also used by catcache operations, without - * any direct connection to hash indexes. Also, the common hash_any - * routine is also used by dynahash tables. - */ -extern Datum hashchar(PG_FUNCTION_ARGS); -extern Datum hashint2(PG_FUNCTION_ARGS); -extern Datum hashint4(PG_FUNCTION_ARGS); -extern Datum hashint8(PG_FUNCTION_ARGS); -extern Datum hashoid(PG_FUNCTION_ARGS); -extern Datum hashenum(PG_FUNCTION_ARGS); -extern Datum hashfloat4(PG_FUNCTION_ARGS); -extern Datum hashfloat8(PG_FUNCTION_ARGS); -extern Datum hashoidvector(PG_FUNCTION_ARGS); -extern Datum hashname(PG_FUNCTION_ARGS); -extern Datum hashtext(PG_FUNCTION_ARGS); -extern Datum hashvarlena(PG_FUNCTION_ARGS); extern Datum hash_any(register const unsigned char *k, register int keylen); extern Datum hash_uint32(uint32 k); diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 181f3acce2..011a72ecf7 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -654,7 +654,6 @@ typedef BTScanOpaqueData *BTScanOpaque; /* * prototypes for functions in nbtree.c (external entry points for btree) */ -extern Datum bthandler(PG_FUNCTION_ARGS); extern IndexBuildResult *btbuild(Relation heap, Relation index, struct IndexInfo *indexInfo); extern void btbuildempty(Relation index); diff --git a/src/include/access/spgist.h b/src/include/access/spgist.h index 64163c5bc7..aaf78bca97 100644 --- a/src/include/access/spgist.h +++ b/src/include/access/spgist.h @@ -183,7 +183,6 @@ typedef struct spgLeafConsistentOut /* spgutils.c */ -extern Datum spghandler(PG_FUNCTION_ARGS); extern bytea *spgoptions(Datum reloptions, bool validate); /* spginsert.c */ diff --git a/src/include/access/xlog_fn.h b/src/include/access/xlog_fn.h deleted file mode 100644 index a013d047a2..0000000000 --- a/src/include/access/xlog_fn.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * xlog_fn.h - * - * PostgreSQL transaction log SQL-callable function declarations - * - * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * src/include/access/xlog_fn.h - */ -#ifndef XLOG_FN_H -#define XLOG_FN_H - -#include "fmgr.h" - -extern Datum pg_start_backup(PG_FUNCTION_ARGS); -extern Datum pg_stop_backup(PG_FUNCTION_ARGS); -extern Datum pg_stop_backup_v2(PG_FUNCTION_ARGS); -extern Datum pg_switch_xlog(PG_FUNCTION_ARGS); -extern Datum pg_create_restore_point(PG_FUNCTION_ARGS); -extern Datum pg_current_xlog_location(PG_FUNCTION_ARGS); -extern Datum pg_current_xlog_insert_location(PG_FUNCTION_ARGS); -extern Datum pg_current_xlog_flush_location(PG_FUNCTION_ARGS); -extern Datum pg_last_xlog_receive_location(PG_FUNCTION_ARGS); -extern Datum pg_last_xlog_replay_location(PG_FUNCTION_ARGS); -extern Datum pg_last_xact_replay_timestamp(PG_FUNCTION_ARGS); -extern Datum pg_xlogfile_name_offset(PG_FUNCTION_ARGS); -extern Datum pg_xlogfile_name(PG_FUNCTION_ARGS); -extern Datum pg_is_in_recovery(PG_FUNCTION_ARGS); -extern Datum pg_xlog_replay_pause(PG_FUNCTION_ARGS); -extern Datum pg_xlog_replay_resume(PG_FUNCTION_ARGS); -extern Datum pg_is_xlog_replay_paused(PG_FUNCTION_ARGS); -extern Datum pg_xlog_location_diff(PG_FUNCTION_ARGS); -extern Datum pg_is_in_backup(PG_FUNCTION_ARGS); -extern Datum pg_backup_start_time(PG_FUNCTION_ARGS); - -#endif /* XLOG_FN_H */ diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 4e425e1b51..42f36891af 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -2058,6 +2058,7 @@ DATA(insert OID = 1671 ( varbitlt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 DATA(insert OID = 1672 ( varbitcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "1562 1562" _null_ _null_ _null_ _null_ _null_ bitcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); +/* avoid the C names bitand and bitor, since they are C++ keywords */ DATA(insert OID = 1673 ( bitand PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ _null_ bit_and _null_ _null_ _null_ )); DATA(insert OID = 1674 ( bitor PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ _null_ bit_or _null_ _null_ _null_ )); DATA(insert OID = 1675 ( bitxor PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ _null_ bitxor _null_ _null_ _null_ )); diff --git a/src/include/commands/async.h b/src/include/commands/async.h index 298d7a92df..b7842d1a0f 100644 --- a/src/include/commands/async.h +++ b/src/include/commands/async.h @@ -38,11 +38,6 @@ extern void Async_Listen(const char *channel); extern void Async_Unlisten(const char *channel); extern void Async_UnlistenAll(void); -/* notify-related SQL functions */ -extern Datum pg_listening_channels(PG_FUNCTION_ARGS); -extern Datum pg_notify(PG_FUNCTION_ARGS); -extern Datum pg_notification_queue_usage(PG_FUNCTION_ARGS); - /* perform (or cancel) outbound notify processing at transaction commit */ extern void PreCommit_Notify(void); extern void AtCommit_Notify(void); diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h index df8cc2b94b..144c3c2e6f 100644 --- a/src/include/commands/sequence.h +++ b/src/include/commands/sequence.h @@ -52,14 +52,6 @@ typedef struct xl_seq_rec } xl_seq_rec; extern Datum nextval(PG_FUNCTION_ARGS); -extern Datum nextval_oid(PG_FUNCTION_ARGS); -extern Datum currval_oid(PG_FUNCTION_ARGS); -extern Datum setval_oid(PG_FUNCTION_ARGS); -extern Datum setval3_oid(PG_FUNCTION_ARGS); -extern Datum lastval(PG_FUNCTION_ARGS); - -extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS); -extern Datum pg_sequence_last_value(PG_FUNCTION_ARGS); extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt); extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt); diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index 9db1c4a1a8..d73969c874 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -212,6 +212,4 @@ extern bool RI_Initial_Check(Trigger *trigger, extern int RI_FKey_trigger_type(Oid tgfoid); -extern Datum pg_trigger_depth(PG_FUNCTION_ARGS); - #endif /* TRIGGER_H */ diff --git a/src/include/libpq/be-fsstubs.h b/src/include/libpq/be-fsstubs.h index e232749f68..641124cd21 100644 --- a/src/include/libpq/be-fsstubs.h +++ b/src/include/libpq/be-fsstubs.h @@ -14,37 +14,6 @@ #ifndef BE_FSSTUBS_H #define BE_FSSTUBS_H -#include "fmgr.h" - -/* - * LO functions available via pg_proc entries - */ -extern Datum be_lo_import(PG_FUNCTION_ARGS); -extern Datum be_lo_import_with_oid(PG_FUNCTION_ARGS); -extern Datum be_lo_export(PG_FUNCTION_ARGS); - -extern Datum be_lo_creat(PG_FUNCTION_ARGS); -extern Datum be_lo_create(PG_FUNCTION_ARGS); -extern Datum be_lo_from_bytea(PG_FUNCTION_ARGS); - -extern Datum be_lo_open(PG_FUNCTION_ARGS); -extern Datum be_lo_close(PG_FUNCTION_ARGS); - -extern Datum be_loread(PG_FUNCTION_ARGS); -extern Datum be_lowrite(PG_FUNCTION_ARGS); - -extern Datum be_lo_get(PG_FUNCTION_ARGS); -extern Datum be_lo_get_fragment(PG_FUNCTION_ARGS); -extern Datum be_lo_put(PG_FUNCTION_ARGS); - -extern Datum be_lo_lseek(PG_FUNCTION_ARGS); -extern Datum be_lo_tell(PG_FUNCTION_ARGS); -extern Datum be_lo_lseek64(PG_FUNCTION_ARGS); -extern Datum be_lo_tell64(PG_FUNCTION_ARGS); -extern Datum be_lo_unlink(PG_FUNCTION_ARGS); -extern Datum be_lo_truncate(PG_FUNCTION_ARGS); -extern Datum be_lo_truncate64(PG_FUNCTION_ARGS); - /* * compatibility option for access control */ diff --git a/src/include/replication/logicalfuncs.h b/src/include/replication/logicalfuncs.h index 37d68475fb..71faee18cf 100644 --- a/src/include/replication/logicalfuncs.h +++ b/src/include/replication/logicalfuncs.h @@ -16,11 +16,4 @@ extern int logical_read_local_xlog_page(XLogReaderState *state, int reqLen, XLogRecPtr targetRecPtr, char *cur_page, TimeLineID *pageTLI); -extern Datum pg_logical_slot_get_changes(PG_FUNCTION_ARGS); -extern Datum pg_logical_slot_get_binary_changes(PG_FUNCTION_ARGS); -extern Datum pg_logical_slot_peek_changes(PG_FUNCTION_ARGS); -extern Datum pg_logical_slot_peek_binary_changes(PG_FUNCTION_ARGS); - -extern Datum pg_logical_emit_message_bytea(PG_FUNCTION_ARGS); -extern Datum pg_logical_emit_message_text(PG_FUNCTION_ARGS); #endif diff --git a/src/include/replication/origin.h b/src/include/replication/origin.h index 58aa3034a6..d6b8eb9d80 100644 --- a/src/include/replication/origin.h +++ b/src/include/replication/origin.h @@ -71,18 +71,4 @@ const char *replorigin_identify(uint8 info); extern Size ReplicationOriginShmemSize(void); extern void ReplicationOriginShmemInit(void); -/* SQL callable functions */ -extern Datum pg_replication_origin_create(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_drop(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_oid(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_session_setup(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_session_reset(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_session_is_setup(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_session_progress(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_xact_setup(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_xact_reset(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_advance(PG_FUNCTION_ARGS); -extern Datum pg_replication_origin_progress(PG_FUNCTION_ARGS); -extern Datum pg_show_replication_origin_status(PG_FUNCTION_ARGS); - #endif /* PG_ORIGIN_H */ diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h index a83762da4c..62cacdb384 100644 --- a/src/include/replication/slot.h +++ b/src/include/replication/slot.h @@ -183,10 +183,4 @@ extern void CheckPointReplicationSlots(void); extern void CheckSlotRequirements(void); -/* SQL callable functions */ -extern Datum pg_create_physical_replication_slot(PG_FUNCTION_ARGS); -extern Datum pg_create_logical_replication_slot(PG_FUNCTION_ARGS); -extern Datum pg_drop_replication_slot(PG_FUNCTION_ARGS); -extern Datum pg_get_replication_slots(PG_FUNCTION_ARGS); - #endif /* SLOT_H */ diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h index 70b3b9d7ba..6ab2c6f9a5 100644 --- a/src/include/replication/walreceiver.h +++ b/src/include/replication/walreceiver.h @@ -195,7 +195,6 @@ extern PGDLLIMPORT WalReceiverFunctionsType *WalReceiverFunctions; /* prototypes for functions in walreceiver.c */ extern void WalReceiverMain(void) pg_attribute_noreturn(); -extern Datum pg_stat_get_wal_receiver(PG_FUNCTION_ARGS); /* prototypes for functions in walreceiverfuncs.c */ extern Size WalRcvShmemSize(void); diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h index f1b1993082..fe23f6619f 100644 --- a/src/include/replication/walsender.h +++ b/src/include/replication/walsender.h @@ -36,8 +36,6 @@ extern void WalSndShmemInit(void); extern void WalSndWakeup(void); extern void WalSndRqstFileReload(void); -extern Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS); - /* * Remember that we want to wakeup walsenders later * diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h index 7628e39f56..9ce6829655 100644 --- a/src/include/storage/smgr.h +++ b/src/include/storage/smgr.h @@ -144,10 +144,4 @@ extern void RememberFsyncRequest(RelFileNode rnode, ForkNumber forknum, extern void ForgetRelationFsyncRequests(RelFileNode rnode, ForkNumber forknum); extern void ForgetDatabaseFsyncRequests(Oid dbid); -/* smgrtype.c */ -extern Datum smgrout(PG_FUNCTION_ARGS); -extern Datum smgrin(PG_FUNCTION_ARGS); -extern Datum smgreq(PG_FUNCTION_ARGS); -extern Datum smgrne(PG_FUNCTION_ARGS); - #endif /* SMGR_H */ diff --git a/src/include/tsearch/ts_type.h b/src/include/tsearch/ts_type.h index aa41953248..155650c6f3 100644 --- a/src/include/tsearch/ts_type.h +++ b/src/include/tsearch/ts_type.h @@ -121,61 +121,6 @@ typedef TSVectorData *TSVector; #define PG_GETARG_TSVECTOR_COPY(n) DatumGetTSVectorCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_TSVECTOR(x) return TSVectorGetDatum(x) -/* - * I/O - */ -extern Datum tsvectorin(PG_FUNCTION_ARGS); -extern Datum tsvectorout(PG_FUNCTION_ARGS); -extern Datum tsvectorsend(PG_FUNCTION_ARGS); -extern Datum tsvectorrecv(PG_FUNCTION_ARGS); - -/* - * operations with tsvector - */ -extern Datum tsvector_lt(PG_FUNCTION_ARGS); -extern Datum tsvector_le(PG_FUNCTION_ARGS); -extern Datum tsvector_eq(PG_FUNCTION_ARGS); -extern Datum tsvector_ne(PG_FUNCTION_ARGS); -extern Datum tsvector_ge(PG_FUNCTION_ARGS); -extern Datum tsvector_gt(PG_FUNCTION_ARGS); -extern Datum tsvector_cmp(PG_FUNCTION_ARGS); - -extern Datum tsvector_length(PG_FUNCTION_ARGS); -extern Datum tsvector_strip(PG_FUNCTION_ARGS); -extern Datum tsvector_setweight(PG_FUNCTION_ARGS); -extern Datum tsvector_setweight_by_filter(PG_FUNCTION_ARGS); -extern Datum tsvector_concat(PG_FUNCTION_ARGS); -extern Datum tsvector_delete_str(PG_FUNCTION_ARGS); -extern Datum tsvector_delete_arr(PG_FUNCTION_ARGS); -extern Datum tsvector_unnest(PG_FUNCTION_ARGS); -extern Datum tsvector_to_array(PG_FUNCTION_ARGS); -extern Datum array_to_tsvector(PG_FUNCTION_ARGS); -extern Datum tsvector_filter(PG_FUNCTION_ARGS); -extern Datum tsvector_update_trigger_byid(PG_FUNCTION_ARGS); -extern Datum tsvector_update_trigger_bycolumn(PG_FUNCTION_ARGS); - -extern Datum ts_match_vq(PG_FUNCTION_ARGS); -extern Datum ts_match_qv(PG_FUNCTION_ARGS); -extern Datum ts_match_tt(PG_FUNCTION_ARGS); -extern Datum ts_match_tq(PG_FUNCTION_ARGS); - -extern Datum ts_stat1(PG_FUNCTION_ARGS); -extern Datum ts_stat2(PG_FUNCTION_ARGS); - -extern Datum ts_rank_tt(PG_FUNCTION_ARGS); -extern Datum ts_rank_wtt(PG_FUNCTION_ARGS); -extern Datum ts_rank_ttf(PG_FUNCTION_ARGS); -extern Datum ts_rank_wttf(PG_FUNCTION_ARGS); -extern Datum ts_rankcd_tt(PG_FUNCTION_ARGS); -extern Datum ts_rankcd_wtt(PG_FUNCTION_ARGS); -extern Datum ts_rankcd_ttf(PG_FUNCTION_ARGS); -extern Datum ts_rankcd_wttf(PG_FUNCTION_ARGS); - -extern Datum tsmatchsel(PG_FUNCTION_ARGS); -extern Datum tsmatchjoinsel(PG_FUNCTION_ARGS); - -extern Datum ts_typanalyze(PG_FUNCTION_ARGS); - /* * TSQuery @@ -294,38 +239,4 @@ typedef TSQueryData *TSQuery; #define PG_GETARG_TSQUERY_COPY(n) DatumGetTSQueryCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_TSQUERY(x) return TSQueryGetDatum(x) -/* - * I/O - */ -extern Datum tsqueryin(PG_FUNCTION_ARGS); -extern Datum tsqueryout(PG_FUNCTION_ARGS); -extern Datum tsquerysend(PG_FUNCTION_ARGS); -extern Datum tsqueryrecv(PG_FUNCTION_ARGS); - -/* - * operations with tsquery - */ -extern Datum tsquery_lt(PG_FUNCTION_ARGS); -extern Datum tsquery_le(PG_FUNCTION_ARGS); -extern Datum tsquery_eq(PG_FUNCTION_ARGS); -extern Datum tsquery_ne(PG_FUNCTION_ARGS); -extern Datum tsquery_ge(PG_FUNCTION_ARGS); -extern Datum tsquery_gt(PG_FUNCTION_ARGS); -extern Datum tsquery_cmp(PG_FUNCTION_ARGS); - -extern Datum tsquerytree(PG_FUNCTION_ARGS); -extern Datum tsquery_numnode(PG_FUNCTION_ARGS); - -extern Datum tsquery_and(PG_FUNCTION_ARGS); -extern Datum tsquery_or(PG_FUNCTION_ARGS); -extern Datum tsquery_phrase(PG_FUNCTION_ARGS); -extern Datum tsquery_phrase_distance(PG_FUNCTION_ARGS); -extern Datum tsquery_not(PG_FUNCTION_ARGS); - -extern Datum tsquery_rewrite(PG_FUNCTION_ARGS); -extern Datum tsquery_rewrite_query(PG_FUNCTION_ARGS); - -extern Datum tsq_mcontains(PG_FUNCTION_ARGS); -extern Datum tsq_mcontained(PG_FUNCTION_ARGS); - #endif /* _PG_TSTYPE_H_ */ diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h index 5de164f4da..20d90b12fd 100644 --- a/src/include/tsearch/ts_utils.h +++ b/src/include/tsearch/ts_utils.h @@ -184,51 +184,6 @@ extern bool tsquery_requires_match(QueryItem *curitem); extern TSVector make_tsvector(ParsedText *prs); extern int32 tsCompareString(char *a, int lena, char *b, int lenb, bool prefix); -extern Datum to_tsvector_byid(PG_FUNCTION_ARGS); -extern Datum to_tsvector(PG_FUNCTION_ARGS); -extern Datum to_tsquery_byid(PG_FUNCTION_ARGS); -extern Datum to_tsquery(PG_FUNCTION_ARGS); -extern Datum plainto_tsquery_byid(PG_FUNCTION_ARGS); -extern Datum plainto_tsquery(PG_FUNCTION_ARGS); -extern Datum phraseto_tsquery_byid(PG_FUNCTION_ARGS); -extern Datum phraseto_tsquery(PG_FUNCTION_ARGS); - -/* - * GiST support function - */ - -extern Datum gtsvector_compress(PG_FUNCTION_ARGS); -extern Datum gtsvector_decompress(PG_FUNCTION_ARGS); -extern Datum gtsvector_consistent(PG_FUNCTION_ARGS); -extern Datum gtsvector_union(PG_FUNCTION_ARGS); -extern Datum gtsvector_same(PG_FUNCTION_ARGS); -extern Datum gtsvector_penalty(PG_FUNCTION_ARGS); -extern Datum gtsvector_picksplit(PG_FUNCTION_ARGS); -extern Datum gtsvector_consistent_oldsig(PG_FUNCTION_ARGS); - -/* - * IO functions for pseudotype gtsvector - * used internally in tsvector GiST opclass - */ -extern Datum gtsvectorin(PG_FUNCTION_ARGS); -extern Datum gtsvectorout(PG_FUNCTION_ARGS); - -/* - * GIN support function - */ - -extern Datum gin_extract_tsvector(PG_FUNCTION_ARGS); -extern Datum gin_cmp_tslexeme(PG_FUNCTION_ARGS); -extern Datum gin_cmp_prefix(PG_FUNCTION_ARGS); -extern Datum gin_extract_tsquery(PG_FUNCTION_ARGS); -extern Datum gin_tsquery_consistent(PG_FUNCTION_ARGS); -extern Datum gin_tsquery_triconsistent(PG_FUNCTION_ARGS); -extern Datum gin_extract_tsvector_2args(PG_FUNCTION_ARGS); -extern Datum gin_extract_tsquery_5args(PG_FUNCTION_ARGS); -extern Datum gin_tsquery_consistent_6args(PG_FUNCTION_ARGS); -extern Datum gin_extract_tsquery_oldsig(PG_FUNCTION_ARGS); -extern Datum gin_tsquery_consistent_oldsig(PG_FUNCTION_ARGS); - /* * Possible strategy numbers for indexes * TSearchStrategyNumber - (tsvector|text) @@ tsquery @@ -282,76 +237,4 @@ extern TSQuerySign makeTSQuerySign(TSQuery a); extern QTNode *findsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind); -/* - * TSQuery GiST support - */ -extern Datum gtsquery_compress(PG_FUNCTION_ARGS); -extern Datum gtsquery_decompress(PG_FUNCTION_ARGS); -extern Datum gtsquery_consistent(PG_FUNCTION_ARGS); -extern Datum gtsquery_union(PG_FUNCTION_ARGS); -extern Datum gtsquery_same(PG_FUNCTION_ARGS); -extern Datum gtsquery_penalty(PG_FUNCTION_ARGS); -extern Datum gtsquery_picksplit(PG_FUNCTION_ARGS); -extern Datum gtsquery_consistent_oldsig(PG_FUNCTION_ARGS); - -/* - * Parser interface to SQL - */ -extern Datum ts_token_type_byid(PG_FUNCTION_ARGS); -extern Datum ts_token_type_byname(PG_FUNCTION_ARGS); -extern Datum ts_parse_byid(PG_FUNCTION_ARGS); -extern Datum ts_parse_byname(PG_FUNCTION_ARGS); - -/* - * Default word parser - */ - -extern Datum prsd_start(PG_FUNCTION_ARGS); -extern Datum prsd_nexttoken(PG_FUNCTION_ARGS); -extern Datum prsd_end(PG_FUNCTION_ARGS); -extern Datum prsd_headline(PG_FUNCTION_ARGS); -extern Datum prsd_lextype(PG_FUNCTION_ARGS); - -/* - * Dictionary interface to SQL - */ -extern Datum ts_lexize(PG_FUNCTION_ARGS); - -/* - * Simple built-in dictionary - */ -extern Datum dsimple_init(PG_FUNCTION_ARGS); -extern Datum dsimple_lexize(PG_FUNCTION_ARGS); - -/* - * Synonym built-in dictionary - */ -extern Datum dsynonym_init(PG_FUNCTION_ARGS); -extern Datum dsynonym_lexize(PG_FUNCTION_ARGS); - -/* - * ISpell dictionary - */ -extern Datum dispell_init(PG_FUNCTION_ARGS); -extern Datum dispell_lexize(PG_FUNCTION_ARGS); - -/* - * Thesaurus - */ -extern Datum thesaurus_init(PG_FUNCTION_ARGS); -extern Datum thesaurus_lexize(PG_FUNCTION_ARGS); - -/* - * headline - */ -extern Datum ts_headline_byid_opt(PG_FUNCTION_ARGS); -extern Datum ts_headline_byid(PG_FUNCTION_ARGS); -extern Datum ts_headline(PG_FUNCTION_ARGS); -extern Datum ts_headline_opt(PG_FUNCTION_ARGS); - -/* - * current cfg - */ -extern Datum get_current_ts_config(PG_FUNCTION_ARGS); - #endif /* _PG_TS_UTILS_H_ */ diff --git a/src/include/utils/.gitignore b/src/include/utils/.gitignore index 808826d147..25db658da5 100644 --- a/src/include/utils/.gitignore +++ b/src/include/utils/.gitignore @@ -1,3 +1,4 @@ /fmgroids.h +/fmgrprotos.h /probes.h /errcodes.h diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h index 433ba2d42e..f397ea1d54 100644 --- a/src/include/utils/acl.h +++ b/src/include/utils/acl.h @@ -242,20 +242,6 @@ extern void select_best_grantor(Oid roleId, AclMode privileges, extern void initialize_acl(void); -/* - * SQL functions (from acl.c) - */ -extern Datum aclitemin(PG_FUNCTION_ARGS); -extern Datum aclitemout(PG_FUNCTION_ARGS); -extern Datum aclinsert(PG_FUNCTION_ARGS); -extern Datum aclremove(PG_FUNCTION_ARGS); -extern Datum aclcontains(PG_FUNCTION_ARGS); -extern Datum makeaclitem(PG_FUNCTION_ARGS); -extern Datum aclitem_eq(PG_FUNCTION_ARGS); -extern Datum hash_aclitem(PG_FUNCTION_ARGS); -extern Datum acldefault_sql(PG_FUNCTION_ARGS); -extern Datum aclexplode(PG_FUNCTION_ARGS); - /* * prototypes for functions in aclchk.c */ diff --git a/src/include/utils/array.h b/src/include/utils/array.h index c0381a9fcd..b0ff73b7e0 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -328,38 +328,6 @@ extern bool Array_nulls; /* * prototypes for functions defined in arrayfuncs.c */ -extern Datum array_in(PG_FUNCTION_ARGS); -extern Datum array_out(PG_FUNCTION_ARGS); -extern Datum array_recv(PG_FUNCTION_ARGS); -extern Datum array_send(PG_FUNCTION_ARGS); -extern Datum array_eq(PG_FUNCTION_ARGS); -extern Datum array_ne(PG_FUNCTION_ARGS); -extern Datum array_lt(PG_FUNCTION_ARGS); -extern Datum array_gt(PG_FUNCTION_ARGS); -extern Datum array_le(PG_FUNCTION_ARGS); -extern Datum array_ge(PG_FUNCTION_ARGS); -extern Datum btarraycmp(PG_FUNCTION_ARGS); -extern Datum hash_array(PG_FUNCTION_ARGS); -extern Datum arrayoverlap(PG_FUNCTION_ARGS); -extern Datum arraycontains(PG_FUNCTION_ARGS); -extern Datum arraycontained(PG_FUNCTION_ARGS); -extern Datum array_ndims(PG_FUNCTION_ARGS); -extern Datum array_dims(PG_FUNCTION_ARGS); -extern Datum array_lower(PG_FUNCTION_ARGS); -extern Datum array_upper(PG_FUNCTION_ARGS); -extern Datum array_length(PG_FUNCTION_ARGS); -extern Datum array_cardinality(PG_FUNCTION_ARGS); -extern Datum array_larger(PG_FUNCTION_ARGS); -extern Datum array_smaller(PG_FUNCTION_ARGS); -extern Datum generate_subscripts(PG_FUNCTION_ARGS); -extern Datum generate_subscripts_nodir(PG_FUNCTION_ARGS); -extern Datum array_fill(PG_FUNCTION_ARGS); -extern Datum array_fill_with_lower_bounds(PG_FUNCTION_ARGS); -extern Datum array_unnest(PG_FUNCTION_ARGS); -extern Datum array_remove(PG_FUNCTION_ARGS); -extern Datum array_replace(PG_FUNCTION_ARGS); -extern Datum width_bucket_array(PG_FUNCTION_ARGS); - extern void CopyArrayEls(ArrayType *array, Datum *values, bool *nulls, @@ -478,28 +446,10 @@ extern void deconstruct_expanded_array(ExpandedArrayHeader *eah); /* * prototypes for functions defined in array_userfuncs.c */ -extern Datum array_append(PG_FUNCTION_ARGS); -extern Datum array_prepend(PG_FUNCTION_ARGS); -extern Datum array_cat(PG_FUNCTION_ARGS); - extern ArrayType *create_singleton_array(FunctionCallInfo fcinfo, Oid element_type, Datum element, bool isNull, int ndims); -extern Datum array_agg_transfn(PG_FUNCTION_ARGS); -extern Datum array_agg_finalfn(PG_FUNCTION_ARGS); -extern Datum array_agg_array_transfn(PG_FUNCTION_ARGS); -extern Datum array_agg_array_finalfn(PG_FUNCTION_ARGS); - -extern Datum array_position(PG_FUNCTION_ARGS); -extern Datum array_position_start(PG_FUNCTION_ARGS); -extern Datum array_positions(PG_FUNCTION_ARGS); - -/* - * prototypes for functions defined in array_typanalyze.c - */ -extern Datum array_typanalyze(PG_FUNCTION_ARGS); - #endif /* ARRAY_H */ diff --git a/src/include/utils/ascii.h b/src/include/utils/ascii.h index 86b70adbee..3771e1acab 100644 --- a/src/include/utils/ascii.h +++ b/src/include/utils/ascii.h @@ -11,12 +11,6 @@ #ifndef _ASCII_H_ #define _ASCII_H_ -#include "fmgr.h" - -extern Datum to_ascii_encname(PG_FUNCTION_ARGS); -extern Datum to_ascii_enc(PG_FUNCTION_ARGS); -extern Datum to_ascii_default(PG_FUNCTION_ARGS); - extern void ascii_safe_strlcpy(char *dest, const char *src, size_t destsiz); #endif /* _ASCII_H_ */ diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index d57c94c677..77944ff8e8 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -15,278 +15,33 @@ #define BUILTINS_H #include "fmgr.h" +#include "fmgrprotos.h" +#include "nodes/nodes.h" +#include "nodes/pg_list.h" #include "utils/sortsupport.h" -/* - * Defined in adt/ - */ - -/* acl.c */ -extern Datum has_any_column_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_any_column_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_any_column_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_any_column_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_any_column_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_any_column_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_name_name_name(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_name_name_attnum(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_name_id_name(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_name_id_attnum(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_id_name_name(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_id_name_attnum(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_id_id_name(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_id_id_attnum(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_name_attnum(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_column_privilege_id_attnum(PG_FUNCTION_ARGS); -extern Datum has_table_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_table_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_table_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_table_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_table_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_table_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_sequence_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_sequence_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_sequence_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_sequence_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_sequence_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_sequence_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_database_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_database_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_database_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_database_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_database_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_database_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_foreign_data_wrapper_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_foreign_data_wrapper_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_foreign_data_wrapper_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_foreign_data_wrapper_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_foreign_data_wrapper_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_foreign_data_wrapper_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_function_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_function_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_function_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_function_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_function_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_function_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_language_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_language_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_language_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_language_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_language_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_language_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_schema_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_schema_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_schema_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_schema_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_schema_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_schema_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_server_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_server_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_server_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_server_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_server_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_server_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_tablespace_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_tablespace_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_tablespace_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_tablespace_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_tablespace_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_tablespace_privilege_id(PG_FUNCTION_ARGS); -extern Datum has_type_privilege_name_name(PG_FUNCTION_ARGS); -extern Datum has_type_privilege_name_id(PG_FUNCTION_ARGS); -extern Datum has_type_privilege_id_name(PG_FUNCTION_ARGS); -extern Datum has_type_privilege_id_id(PG_FUNCTION_ARGS); -extern Datum has_type_privilege_name(PG_FUNCTION_ARGS); -extern Datum has_type_privilege_id(PG_FUNCTION_ARGS); -extern Datum pg_has_role_name_name(PG_FUNCTION_ARGS); -extern Datum pg_has_role_name_id(PG_FUNCTION_ARGS); -extern Datum pg_has_role_id_name(PG_FUNCTION_ARGS); -extern Datum pg_has_role_id_id(PG_FUNCTION_ARGS); -extern Datum pg_has_role_name(PG_FUNCTION_ARGS); -extern Datum pg_has_role_id(PG_FUNCTION_ARGS); - -/* amutils.c */ -extern Datum pg_indexam_has_property(PG_FUNCTION_ARGS); -extern Datum pg_index_has_property(PG_FUNCTION_ARGS); -extern Datum pg_index_column_has_property(PG_FUNCTION_ARGS); /* bool.c */ -extern Datum boolin(PG_FUNCTION_ARGS); -extern Datum boolout(PG_FUNCTION_ARGS); -extern Datum boolrecv(PG_FUNCTION_ARGS); -extern Datum boolsend(PG_FUNCTION_ARGS); -extern Datum booltext(PG_FUNCTION_ARGS); -extern Datum booleq(PG_FUNCTION_ARGS); -extern Datum boolne(PG_FUNCTION_ARGS); -extern Datum boollt(PG_FUNCTION_ARGS); -extern Datum boolgt(PG_FUNCTION_ARGS); -extern Datum boolle(PG_FUNCTION_ARGS); -extern Datum boolge(PG_FUNCTION_ARGS); -extern Datum booland_statefunc(PG_FUNCTION_ARGS); -extern Datum boolor_statefunc(PG_FUNCTION_ARGS); -extern Datum bool_accum(PG_FUNCTION_ARGS); -extern Datum bool_accum_inv(PG_FUNCTION_ARGS); -extern Datum bool_alltrue(PG_FUNCTION_ARGS); -extern Datum bool_anytrue(PG_FUNCTION_ARGS); extern bool parse_bool(const char *value, bool *result); extern bool parse_bool_with_len(const char *value, size_t len, bool *result); -/* char.c */ -extern Datum charin(PG_FUNCTION_ARGS); -extern Datum charout(PG_FUNCTION_ARGS); -extern Datum charrecv(PG_FUNCTION_ARGS); -extern Datum charsend(PG_FUNCTION_ARGS); -extern Datum chareq(PG_FUNCTION_ARGS); -extern Datum charne(PG_FUNCTION_ARGS); -extern Datum charlt(PG_FUNCTION_ARGS); -extern Datum charle(PG_FUNCTION_ARGS); -extern Datum chargt(PG_FUNCTION_ARGS); -extern Datum charge(PG_FUNCTION_ARGS); -extern Datum chartoi4(PG_FUNCTION_ARGS); -extern Datum i4tochar(PG_FUNCTION_ARGS); -extern Datum text_char(PG_FUNCTION_ARGS); -extern Datum char_text(PG_FUNCTION_ARGS); - /* domains.c */ -extern Datum domain_in(PG_FUNCTION_ARGS); -extern Datum domain_recv(PG_FUNCTION_ARGS); extern void domain_check(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt); extern int errdatatype(Oid datatypeOid); extern int errdomainconstraint(Oid datatypeOid, const char *conname); /* encode.c */ -extern Datum binary_encode(PG_FUNCTION_ARGS); -extern Datum binary_decode(PG_FUNCTION_ARGS); extern unsigned hex_encode(const char *src, unsigned len, char *dst); extern unsigned hex_decode(const char *src, unsigned len, char *dst); -/* enum.c */ -extern Datum enum_in(PG_FUNCTION_ARGS); -extern Datum enum_out(PG_FUNCTION_ARGS); -extern Datum enum_recv(PG_FUNCTION_ARGS); -extern Datum enum_send(PG_FUNCTION_ARGS); -extern Datum enum_lt(PG_FUNCTION_ARGS); -extern Datum enum_le(PG_FUNCTION_ARGS); -extern Datum enum_eq(PG_FUNCTION_ARGS); -extern Datum enum_ne(PG_FUNCTION_ARGS); -extern Datum enum_ge(PG_FUNCTION_ARGS); -extern Datum enum_gt(PG_FUNCTION_ARGS); -extern Datum enum_cmp(PG_FUNCTION_ARGS); -extern Datum enum_smaller(PG_FUNCTION_ARGS); -extern Datum enum_larger(PG_FUNCTION_ARGS); -extern Datum enum_first(PG_FUNCTION_ARGS); -extern Datum enum_last(PG_FUNCTION_ARGS); -extern Datum enum_range_bounds(PG_FUNCTION_ARGS); -extern Datum enum_range_all(PG_FUNCTION_ARGS); - /* int.c */ -extern Datum int2in(PG_FUNCTION_ARGS); -extern Datum int2out(PG_FUNCTION_ARGS); -extern Datum int2recv(PG_FUNCTION_ARGS); -extern Datum int2send(PG_FUNCTION_ARGS); -extern Datum int2vectorin(PG_FUNCTION_ARGS); -extern Datum int2vectorout(PG_FUNCTION_ARGS); -extern Datum int2vectorrecv(PG_FUNCTION_ARGS); -extern Datum int2vectorsend(PG_FUNCTION_ARGS); -extern Datum int4in(PG_FUNCTION_ARGS); -extern Datum int4out(PG_FUNCTION_ARGS); -extern Datum int4recv(PG_FUNCTION_ARGS); -extern Datum int4send(PG_FUNCTION_ARGS); -extern Datum i2toi4(PG_FUNCTION_ARGS); -extern Datum i4toi2(PG_FUNCTION_ARGS); -extern Datum int4_bool(PG_FUNCTION_ARGS); -extern Datum bool_int4(PG_FUNCTION_ARGS); -extern Datum int4eq(PG_FUNCTION_ARGS); -extern Datum int4ne(PG_FUNCTION_ARGS); -extern Datum int4lt(PG_FUNCTION_ARGS); -extern Datum int4le(PG_FUNCTION_ARGS); -extern Datum int4gt(PG_FUNCTION_ARGS); -extern Datum int4ge(PG_FUNCTION_ARGS); -extern Datum int2eq(PG_FUNCTION_ARGS); -extern Datum int2ne(PG_FUNCTION_ARGS); -extern Datum int2lt(PG_FUNCTION_ARGS); -extern Datum int2le(PG_FUNCTION_ARGS); -extern Datum int2gt(PG_FUNCTION_ARGS); -extern Datum int2ge(PG_FUNCTION_ARGS); -extern Datum int24eq(PG_FUNCTION_ARGS); -extern Datum int24ne(PG_FUNCTION_ARGS); -extern Datum int24lt(PG_FUNCTION_ARGS); -extern Datum int24le(PG_FUNCTION_ARGS); -extern Datum int24gt(PG_FUNCTION_ARGS); -extern Datum int24ge(PG_FUNCTION_ARGS); -extern Datum int42eq(PG_FUNCTION_ARGS); -extern Datum int42ne(PG_FUNCTION_ARGS); -extern Datum int42lt(PG_FUNCTION_ARGS); -extern Datum int42le(PG_FUNCTION_ARGS); -extern Datum int42gt(PG_FUNCTION_ARGS); -extern Datum int42ge(PG_FUNCTION_ARGS); -extern Datum int4um(PG_FUNCTION_ARGS); -extern Datum int4up(PG_FUNCTION_ARGS); -extern Datum int4pl(PG_FUNCTION_ARGS); -extern Datum int4mi(PG_FUNCTION_ARGS); -extern Datum int4mul(PG_FUNCTION_ARGS); -extern Datum int4div(PG_FUNCTION_ARGS); -extern Datum int4abs(PG_FUNCTION_ARGS); -extern Datum int4inc(PG_FUNCTION_ARGS); -extern Datum int2um(PG_FUNCTION_ARGS); -extern Datum int2up(PG_FUNCTION_ARGS); -extern Datum int2pl(PG_FUNCTION_ARGS); -extern Datum int2mi(PG_FUNCTION_ARGS); -extern Datum int2mul(PG_FUNCTION_ARGS); -extern Datum int2div(PG_FUNCTION_ARGS); -extern Datum int2abs(PG_FUNCTION_ARGS); -extern Datum int24pl(PG_FUNCTION_ARGS); -extern Datum int24mi(PG_FUNCTION_ARGS); -extern Datum int24mul(PG_FUNCTION_ARGS); -extern Datum int24div(PG_FUNCTION_ARGS); -extern Datum int42pl(PG_FUNCTION_ARGS); -extern Datum int42mi(PG_FUNCTION_ARGS); -extern Datum int42mul(PG_FUNCTION_ARGS); -extern Datum int42div(PG_FUNCTION_ARGS); -extern Datum int4mod(PG_FUNCTION_ARGS); -extern Datum int2mod(PG_FUNCTION_ARGS); -extern Datum int2larger(PG_FUNCTION_ARGS); -extern Datum int2smaller(PG_FUNCTION_ARGS); -extern Datum int4larger(PG_FUNCTION_ARGS); -extern Datum int4smaller(PG_FUNCTION_ARGS); - -extern Datum int4and(PG_FUNCTION_ARGS); -extern Datum int4or(PG_FUNCTION_ARGS); -extern Datum int4xor(PG_FUNCTION_ARGS); -extern Datum int4not(PG_FUNCTION_ARGS); -extern Datum int4shl(PG_FUNCTION_ARGS); -extern Datum int4shr(PG_FUNCTION_ARGS); -extern Datum int2and(PG_FUNCTION_ARGS); -extern Datum int2or(PG_FUNCTION_ARGS); -extern Datum int2xor(PG_FUNCTION_ARGS); -extern Datum int2not(PG_FUNCTION_ARGS); -extern Datum int2shl(PG_FUNCTION_ARGS); -extern Datum int2shr(PG_FUNCTION_ARGS); -extern Datum generate_series_int4(PG_FUNCTION_ARGS); -extern Datum generate_series_step_int4(PG_FUNCTION_ARGS); extern int2vector *buildint2vector(const int16 *int2s, int n); /* name.c */ -extern Datum namein(PG_FUNCTION_ARGS); -extern Datum nameout(PG_FUNCTION_ARGS); -extern Datum namerecv(PG_FUNCTION_ARGS); -extern Datum namesend(PG_FUNCTION_ARGS); -extern Datum nameeq(PG_FUNCTION_ARGS); -extern Datum namene(PG_FUNCTION_ARGS); -extern Datum namelt(PG_FUNCTION_ARGS); -extern Datum namele(PG_FUNCTION_ARGS); -extern Datum namegt(PG_FUNCTION_ARGS); -extern Datum namege(PG_FUNCTION_ARGS); extern int namecpy(Name n1, Name n2); extern int namestrcpy(Name name, const char *str); extern int namestrcmp(Name name, const char *str); -extern Datum current_user(PG_FUNCTION_ARGS); -extern Datum session_user(PG_FUNCTION_ARGS); -extern Datum current_schema(PG_FUNCTION_ARGS); -extern Datum current_schemas(PG_FUNCTION_ARGS); /* numutils.c */ extern int32 pg_atoi(const char *s, int size, int c); @@ -297,47 +52,6 @@ extern char *pg_ltostr_zeropad(char *str, int32 value, int32 minwidth); extern char *pg_ltostr(char *str, int32 value); extern uint64 pg_strtouint64(const char *str, char **endptr, int base); -/* - * Per-opclass comparison functions for new btrees. These are - * stored in pg_amproc; most are defined in access/nbtree/nbtcompare.c - */ -extern Datum btboolcmp(PG_FUNCTION_ARGS); -extern Datum btint2cmp(PG_FUNCTION_ARGS); -extern Datum btint4cmp(PG_FUNCTION_ARGS); -extern Datum btint8cmp(PG_FUNCTION_ARGS); -extern Datum btfloat4cmp(PG_FUNCTION_ARGS); -extern Datum btfloat8cmp(PG_FUNCTION_ARGS); -extern Datum btint48cmp(PG_FUNCTION_ARGS); -extern Datum btint84cmp(PG_FUNCTION_ARGS); -extern Datum btint24cmp(PG_FUNCTION_ARGS); -extern Datum btint42cmp(PG_FUNCTION_ARGS); -extern Datum btint28cmp(PG_FUNCTION_ARGS); -extern Datum btint82cmp(PG_FUNCTION_ARGS); -extern Datum btfloat48cmp(PG_FUNCTION_ARGS); -extern Datum btfloat84cmp(PG_FUNCTION_ARGS); -extern Datum btoidcmp(PG_FUNCTION_ARGS); -extern Datum btoidvectorcmp(PG_FUNCTION_ARGS); -extern Datum btabstimecmp(PG_FUNCTION_ARGS); -extern Datum btreltimecmp(PG_FUNCTION_ARGS); -extern Datum bttintervalcmp(PG_FUNCTION_ARGS); -extern Datum btcharcmp(PG_FUNCTION_ARGS); -extern Datum btnamecmp(PG_FUNCTION_ARGS); -extern Datum bttextcmp(PG_FUNCTION_ARGS); -extern Datum bttextsortsupport(PG_FUNCTION_ARGS); - -/* - * Per-opclass sort support functions for new btrees. Like the - * functions above, these are stored in pg_amproc; most are defined in - * access/nbtree/nbtcompare.c - */ -extern Datum btint2sortsupport(PG_FUNCTION_ARGS); -extern Datum btint4sortsupport(PG_FUNCTION_ARGS); -extern Datum btint8sortsupport(PG_FUNCTION_ARGS); -extern Datum btfloat4sortsupport(PG_FUNCTION_ARGS); -extern Datum btfloat8sortsupport(PG_FUNCTION_ARGS); -extern Datum btoidsortsupport(PG_FUNCTION_ARGS); -extern Datum btnamesortsupport(PG_FUNCTION_ARGS); - /* float.c */ extern PGDLLIMPORT int extra_float_digits; @@ -352,341 +66,15 @@ extern char *float8out_internal(double num); extern int float4_cmp_internal(float4 a, float4 b); extern int float8_cmp_internal(float8 a, float8 b); -extern Datum float4in(PG_FUNCTION_ARGS); -extern Datum float4out(PG_FUNCTION_ARGS); -extern Datum float4recv(PG_FUNCTION_ARGS); -extern Datum float4send(PG_FUNCTION_ARGS); -extern Datum float8in(PG_FUNCTION_ARGS); -extern Datum float8out(PG_FUNCTION_ARGS); -extern Datum float8recv(PG_FUNCTION_ARGS); -extern Datum float8send(PG_FUNCTION_ARGS); -extern Datum float4abs(PG_FUNCTION_ARGS); -extern Datum float4um(PG_FUNCTION_ARGS); -extern Datum float4up(PG_FUNCTION_ARGS); -extern Datum float4larger(PG_FUNCTION_ARGS); -extern Datum float4smaller(PG_FUNCTION_ARGS); -extern Datum float8abs(PG_FUNCTION_ARGS); -extern Datum float8um(PG_FUNCTION_ARGS); -extern Datum float8up(PG_FUNCTION_ARGS); -extern Datum float8larger(PG_FUNCTION_ARGS); -extern Datum float8smaller(PG_FUNCTION_ARGS); -extern Datum float4pl(PG_FUNCTION_ARGS); -extern Datum float4mi(PG_FUNCTION_ARGS); -extern Datum float4mul(PG_FUNCTION_ARGS); -extern Datum float4div(PG_FUNCTION_ARGS); -extern Datum float8pl(PG_FUNCTION_ARGS); -extern Datum float8mi(PG_FUNCTION_ARGS); -extern Datum float8mul(PG_FUNCTION_ARGS); -extern Datum float8div(PG_FUNCTION_ARGS); -extern Datum float4eq(PG_FUNCTION_ARGS); -extern Datum float4ne(PG_FUNCTION_ARGS); -extern Datum float4lt(PG_FUNCTION_ARGS); -extern Datum float4le(PG_FUNCTION_ARGS); -extern Datum float4gt(PG_FUNCTION_ARGS); -extern Datum float4ge(PG_FUNCTION_ARGS); -extern Datum float8eq(PG_FUNCTION_ARGS); -extern Datum float8ne(PG_FUNCTION_ARGS); -extern Datum float8lt(PG_FUNCTION_ARGS); -extern Datum float8le(PG_FUNCTION_ARGS); -extern Datum float8gt(PG_FUNCTION_ARGS); -extern Datum float8ge(PG_FUNCTION_ARGS); -extern Datum ftod(PG_FUNCTION_ARGS); -extern Datum i4tod(PG_FUNCTION_ARGS); -extern Datum i2tod(PG_FUNCTION_ARGS); -extern Datum dtof(PG_FUNCTION_ARGS); -extern Datum dtoi4(PG_FUNCTION_ARGS); -extern Datum dtoi2(PG_FUNCTION_ARGS); -extern Datum i4tof(PG_FUNCTION_ARGS); -extern Datum i2tof(PG_FUNCTION_ARGS); -extern Datum ftoi4(PG_FUNCTION_ARGS); -extern Datum ftoi2(PG_FUNCTION_ARGS); -extern Datum dround(PG_FUNCTION_ARGS); -extern Datum dceil(PG_FUNCTION_ARGS); -extern Datum dfloor(PG_FUNCTION_ARGS); -extern Datum dsign(PG_FUNCTION_ARGS); -extern Datum dtrunc(PG_FUNCTION_ARGS); -extern Datum dsqrt(PG_FUNCTION_ARGS); -extern Datum dcbrt(PG_FUNCTION_ARGS); -extern Datum dpow(PG_FUNCTION_ARGS); -extern Datum dexp(PG_FUNCTION_ARGS); -extern Datum dlog1(PG_FUNCTION_ARGS); -extern Datum dlog10(PG_FUNCTION_ARGS); -extern Datum dacos(PG_FUNCTION_ARGS); -extern Datum dasin(PG_FUNCTION_ARGS); -extern Datum datan(PG_FUNCTION_ARGS); -extern Datum datan2(PG_FUNCTION_ARGS); -extern Datum dcos(PG_FUNCTION_ARGS); -extern Datum dcot(PG_FUNCTION_ARGS); -extern Datum dsin(PG_FUNCTION_ARGS); -extern Datum dtan(PG_FUNCTION_ARGS); -extern Datum dacosd(PG_FUNCTION_ARGS); -extern Datum dasind(PG_FUNCTION_ARGS); -extern Datum datand(PG_FUNCTION_ARGS); -extern Datum datan2d(PG_FUNCTION_ARGS); -extern Datum dcosd(PG_FUNCTION_ARGS); -extern Datum dcotd(PG_FUNCTION_ARGS); -extern Datum dsind(PG_FUNCTION_ARGS); -extern Datum dtand(PG_FUNCTION_ARGS); -extern Datum degrees(PG_FUNCTION_ARGS); -extern Datum dpi(PG_FUNCTION_ARGS); -extern Datum radians(PG_FUNCTION_ARGS); -extern Datum drandom(PG_FUNCTION_ARGS); -extern Datum setseed(PG_FUNCTION_ARGS); -extern Datum float8_combine(PG_FUNCTION_ARGS); -extern Datum float8_accum(PG_FUNCTION_ARGS); -extern Datum float4_accum(PG_FUNCTION_ARGS); -extern Datum float8_avg(PG_FUNCTION_ARGS); -extern Datum float8_var_pop(PG_FUNCTION_ARGS); -extern Datum float8_var_samp(PG_FUNCTION_ARGS); -extern Datum float8_stddev_pop(PG_FUNCTION_ARGS); -extern Datum float8_stddev_samp(PG_FUNCTION_ARGS); -extern Datum float8_regr_accum(PG_FUNCTION_ARGS); -extern Datum float8_regr_combine(PG_FUNCTION_ARGS); -extern Datum float8_regr_sxx(PG_FUNCTION_ARGS); -extern Datum float8_regr_syy(PG_FUNCTION_ARGS); -extern Datum float8_regr_sxy(PG_FUNCTION_ARGS); -extern Datum float8_regr_avgx(PG_FUNCTION_ARGS); -extern Datum float8_regr_avgy(PG_FUNCTION_ARGS); -extern Datum float8_covar_pop(PG_FUNCTION_ARGS); -extern Datum float8_covar_samp(PG_FUNCTION_ARGS); -extern Datum float8_corr(PG_FUNCTION_ARGS); -extern Datum float8_regr_r2(PG_FUNCTION_ARGS); -extern Datum float8_regr_slope(PG_FUNCTION_ARGS); -extern Datum float8_regr_intercept(PG_FUNCTION_ARGS); -extern Datum float48pl(PG_FUNCTION_ARGS); -extern Datum float48mi(PG_FUNCTION_ARGS); -extern Datum float48mul(PG_FUNCTION_ARGS); -extern Datum float48div(PG_FUNCTION_ARGS); -extern Datum float84pl(PG_FUNCTION_ARGS); -extern Datum float84mi(PG_FUNCTION_ARGS); -extern Datum float84mul(PG_FUNCTION_ARGS); -extern Datum float84div(PG_FUNCTION_ARGS); -extern Datum float48eq(PG_FUNCTION_ARGS); -extern Datum float48ne(PG_FUNCTION_ARGS); -extern Datum float48lt(PG_FUNCTION_ARGS); -extern Datum float48le(PG_FUNCTION_ARGS); -extern Datum float48gt(PG_FUNCTION_ARGS); -extern Datum float48ge(PG_FUNCTION_ARGS); -extern Datum float84eq(PG_FUNCTION_ARGS); -extern Datum float84ne(PG_FUNCTION_ARGS); -extern Datum float84lt(PG_FUNCTION_ARGS); -extern Datum float84le(PG_FUNCTION_ARGS); -extern Datum float84gt(PG_FUNCTION_ARGS); -extern Datum float84ge(PG_FUNCTION_ARGS); -extern Datum width_bucket_float8(PG_FUNCTION_ARGS); - -/* dbsize.c */ -extern Datum pg_tablespace_size_oid(PG_FUNCTION_ARGS); -extern Datum pg_tablespace_size_name(PG_FUNCTION_ARGS); -extern Datum pg_database_size_oid(PG_FUNCTION_ARGS); -extern Datum pg_database_size_name(PG_FUNCTION_ARGS); -extern Datum pg_relation_size(PG_FUNCTION_ARGS); -extern Datum pg_total_relation_size(PG_FUNCTION_ARGS); -extern Datum pg_size_pretty(PG_FUNCTION_ARGS); -extern Datum pg_size_pretty_numeric(PG_FUNCTION_ARGS); -extern Datum pg_size_bytes(PG_FUNCTION_ARGS); -extern Datum pg_table_size(PG_FUNCTION_ARGS); -extern Datum pg_indexes_size(PG_FUNCTION_ARGS); -extern Datum pg_relation_filenode(PG_FUNCTION_ARGS); -extern Datum pg_filenode_relation(PG_FUNCTION_ARGS); -extern Datum pg_relation_filepath(PG_FUNCTION_ARGS); - -/* genfile.c */ -extern Datum pg_stat_file(PG_FUNCTION_ARGS); -extern Datum pg_stat_file_1arg(PG_FUNCTION_ARGS); -extern Datum pg_read_file(PG_FUNCTION_ARGS); -extern Datum pg_read_file_off_len(PG_FUNCTION_ARGS); -extern Datum pg_read_file_all(PG_FUNCTION_ARGS); -extern Datum pg_read_binary_file(PG_FUNCTION_ARGS); -extern Datum pg_read_binary_file_off_len(PG_FUNCTION_ARGS); -extern Datum pg_read_binary_file_all(PG_FUNCTION_ARGS); -extern Datum pg_ls_dir(PG_FUNCTION_ARGS); -extern Datum pg_ls_dir_1arg(PG_FUNCTION_ARGS); - -/* misc.c */ -extern Datum pg_num_nulls(PG_FUNCTION_ARGS); -extern Datum pg_num_nonnulls(PG_FUNCTION_ARGS); -extern Datum current_database(PG_FUNCTION_ARGS); -extern Datum current_query(PG_FUNCTION_ARGS); -extern Datum pg_cancel_backend(PG_FUNCTION_ARGS); -extern Datum pg_terminate_backend(PG_FUNCTION_ARGS); -extern Datum pg_reload_conf(PG_FUNCTION_ARGS); -extern Datum pg_tablespace_databases(PG_FUNCTION_ARGS); -extern Datum pg_tablespace_location(PG_FUNCTION_ARGS); -extern Datum pg_rotate_logfile(PG_FUNCTION_ARGS); -extern Datum pg_sleep(PG_FUNCTION_ARGS); -extern Datum pg_get_keywords(PG_FUNCTION_ARGS); -extern Datum pg_typeof(PG_FUNCTION_ARGS); -extern Datum pg_collation_for(PG_FUNCTION_ARGS); -extern Datum pg_relation_is_updatable(PG_FUNCTION_ARGS); -extern Datum pg_column_is_updatable(PG_FUNCTION_ARGS); -extern Datum parse_ident(PG_FUNCTION_ARGS); - /* oid.c */ -extern Datum oidin(PG_FUNCTION_ARGS); -extern Datum oidout(PG_FUNCTION_ARGS); -extern Datum oidrecv(PG_FUNCTION_ARGS); -extern Datum oidsend(PG_FUNCTION_ARGS); -extern Datum oideq(PG_FUNCTION_ARGS); -extern Datum oidne(PG_FUNCTION_ARGS); -extern Datum oidlt(PG_FUNCTION_ARGS); -extern Datum oidle(PG_FUNCTION_ARGS); -extern Datum oidge(PG_FUNCTION_ARGS); -extern Datum oidgt(PG_FUNCTION_ARGS); -extern Datum oidlarger(PG_FUNCTION_ARGS); -extern Datum oidsmaller(PG_FUNCTION_ARGS); -extern Datum oidvectorin(PG_FUNCTION_ARGS); -extern Datum oidvectorout(PG_FUNCTION_ARGS); -extern Datum oidvectorrecv(PG_FUNCTION_ARGS); -extern Datum oidvectorsend(PG_FUNCTION_ARGS); -extern Datum oidvectoreq(PG_FUNCTION_ARGS); -extern Datum oidvectorne(PG_FUNCTION_ARGS); -extern Datum oidvectorlt(PG_FUNCTION_ARGS); -extern Datum oidvectorle(PG_FUNCTION_ARGS); -extern Datum oidvectorge(PG_FUNCTION_ARGS); -extern Datum oidvectorgt(PG_FUNCTION_ARGS); extern oidvector *buildoidvector(const Oid *oids, int n); extern Oid oidparse(Node *node); -/* orderedsetaggs.c */ -extern Datum ordered_set_transition(PG_FUNCTION_ARGS); -extern Datum ordered_set_transition_multi(PG_FUNCTION_ARGS); -extern Datum percentile_disc_final(PG_FUNCTION_ARGS); -extern Datum percentile_cont_float8_final(PG_FUNCTION_ARGS); -extern Datum percentile_cont_interval_final(PG_FUNCTION_ARGS); -extern Datum percentile_disc_multi_final(PG_FUNCTION_ARGS); -extern Datum percentile_cont_float8_multi_final(PG_FUNCTION_ARGS); -extern Datum percentile_cont_interval_multi_final(PG_FUNCTION_ARGS); -extern Datum mode_final(PG_FUNCTION_ARGS); -extern Datum hypothetical_rank_final(PG_FUNCTION_ARGS); -extern Datum hypothetical_percent_rank_final(PG_FUNCTION_ARGS); -extern Datum hypothetical_cume_dist_final(PG_FUNCTION_ARGS); -extern Datum hypothetical_dense_rank_final(PG_FUNCTION_ARGS); - -/* pseudotypes.c */ -extern Datum cstring_in(PG_FUNCTION_ARGS); -extern Datum cstring_out(PG_FUNCTION_ARGS); -extern Datum cstring_recv(PG_FUNCTION_ARGS); -extern Datum cstring_send(PG_FUNCTION_ARGS); -extern Datum any_in(PG_FUNCTION_ARGS); -extern Datum any_out(PG_FUNCTION_ARGS); -extern Datum anyarray_in(PG_FUNCTION_ARGS); -extern Datum anyarray_out(PG_FUNCTION_ARGS); -extern Datum anyarray_recv(PG_FUNCTION_ARGS); -extern Datum anyarray_send(PG_FUNCTION_ARGS); -extern Datum anynonarray_in(PG_FUNCTION_ARGS); -extern Datum anynonarray_out(PG_FUNCTION_ARGS); -extern Datum anyenum_in(PG_FUNCTION_ARGS); -extern Datum anyenum_out(PG_FUNCTION_ARGS); -extern Datum anyrange_in(PG_FUNCTION_ARGS); -extern Datum anyrange_out(PG_FUNCTION_ARGS); -extern Datum void_in(PG_FUNCTION_ARGS); -extern Datum void_out(PG_FUNCTION_ARGS); -extern Datum void_recv(PG_FUNCTION_ARGS); -extern Datum void_send(PG_FUNCTION_ARGS); -extern Datum trigger_in(PG_FUNCTION_ARGS); -extern Datum trigger_out(PG_FUNCTION_ARGS); -extern Datum event_trigger_in(PG_FUNCTION_ARGS); -extern Datum event_trigger_out(PG_FUNCTION_ARGS); -extern Datum language_handler_in(PG_FUNCTION_ARGS); -extern Datum language_handler_out(PG_FUNCTION_ARGS); -extern Datum fdw_handler_in(PG_FUNCTION_ARGS); -extern Datum fdw_handler_out(PG_FUNCTION_ARGS); -extern Datum index_am_handler_in(PG_FUNCTION_ARGS); -extern Datum index_am_handler_out(PG_FUNCTION_ARGS); -extern Datum tsm_handler_in(PG_FUNCTION_ARGS); -extern Datum tsm_handler_out(PG_FUNCTION_ARGS); -extern Datum internal_in(PG_FUNCTION_ARGS); -extern Datum internal_out(PG_FUNCTION_ARGS); -extern Datum opaque_in(PG_FUNCTION_ARGS); -extern Datum opaque_out(PG_FUNCTION_ARGS); -extern Datum anyelement_in(PG_FUNCTION_ARGS); -extern Datum anyelement_out(PG_FUNCTION_ARGS); -extern Datum shell_in(PG_FUNCTION_ARGS); -extern Datum shell_out(PG_FUNCTION_ARGS); -extern Datum pg_node_tree_in(PG_FUNCTION_ARGS); -extern Datum pg_node_tree_out(PG_FUNCTION_ARGS); -extern Datum pg_node_tree_recv(PG_FUNCTION_ARGS); -extern Datum pg_node_tree_send(PG_FUNCTION_ARGS); -extern Datum pg_ddl_command_in(PG_FUNCTION_ARGS); -extern Datum pg_ddl_command_out(PG_FUNCTION_ARGS); -extern Datum pg_ddl_command_recv(PG_FUNCTION_ARGS); -extern Datum pg_ddl_command_send(PG_FUNCTION_ARGS); - /* regexp.c */ -extern Datum nameregexeq(PG_FUNCTION_ARGS); -extern Datum nameregexne(PG_FUNCTION_ARGS); -extern Datum textregexeq(PG_FUNCTION_ARGS); -extern Datum textregexne(PG_FUNCTION_ARGS); -extern Datum nameicregexeq(PG_FUNCTION_ARGS); -extern Datum nameicregexne(PG_FUNCTION_ARGS); -extern Datum texticregexeq(PG_FUNCTION_ARGS); -extern Datum texticregexne(PG_FUNCTION_ARGS); -extern Datum textregexsubstr(PG_FUNCTION_ARGS); -extern Datum textregexreplace_noopt(PG_FUNCTION_ARGS); -extern Datum textregexreplace(PG_FUNCTION_ARGS); -extern Datum similar_escape(PG_FUNCTION_ARGS); -extern Datum regexp_match(PG_FUNCTION_ARGS); -extern Datum regexp_match_no_flags(PG_FUNCTION_ARGS); -extern Datum regexp_matches(PG_FUNCTION_ARGS); -extern Datum regexp_matches_no_flags(PG_FUNCTION_ARGS); -extern Datum regexp_split_to_table(PG_FUNCTION_ARGS); -extern Datum regexp_split_to_table_no_flags(PG_FUNCTION_ARGS); -extern Datum regexp_split_to_array(PG_FUNCTION_ARGS); -extern Datum regexp_split_to_array_no_flags(PG_FUNCTION_ARGS); extern char *regexp_fixed_prefix(text *text_re, bool case_insensitive, Oid collation, bool *exact); /* regproc.c */ -extern Datum regprocin(PG_FUNCTION_ARGS); -extern Datum regprocout(PG_FUNCTION_ARGS); -extern Datum to_regproc(PG_FUNCTION_ARGS); -extern Datum to_regprocedure(PG_FUNCTION_ARGS); -extern Datum regprocrecv(PG_FUNCTION_ARGS); -extern Datum regprocsend(PG_FUNCTION_ARGS); -extern Datum regprocedurein(PG_FUNCTION_ARGS); -extern Datum regprocedureout(PG_FUNCTION_ARGS); -extern Datum regprocedurerecv(PG_FUNCTION_ARGS); -extern Datum regproceduresend(PG_FUNCTION_ARGS); -extern Datum regoperin(PG_FUNCTION_ARGS); -extern Datum regoperout(PG_FUNCTION_ARGS); -extern Datum regoperrecv(PG_FUNCTION_ARGS); -extern Datum regopersend(PG_FUNCTION_ARGS); -extern Datum to_regoper(PG_FUNCTION_ARGS); -extern Datum to_regoperator(PG_FUNCTION_ARGS); -extern Datum regoperatorin(PG_FUNCTION_ARGS); -extern Datum regoperatorout(PG_FUNCTION_ARGS); -extern Datum regoperatorrecv(PG_FUNCTION_ARGS); -extern Datum regoperatorsend(PG_FUNCTION_ARGS); -extern Datum regclassin(PG_FUNCTION_ARGS); -extern Datum regclassout(PG_FUNCTION_ARGS); -extern Datum regclassrecv(PG_FUNCTION_ARGS); -extern Datum regclasssend(PG_FUNCTION_ARGS); -extern Datum to_regclass(PG_FUNCTION_ARGS); -extern Datum regtypein(PG_FUNCTION_ARGS); -extern Datum regtypeout(PG_FUNCTION_ARGS); -extern Datum regtyperecv(PG_FUNCTION_ARGS); -extern Datum regtypesend(PG_FUNCTION_ARGS); -extern Datum to_regtype(PG_FUNCTION_ARGS); -extern Datum regrolein(PG_FUNCTION_ARGS); -extern Datum regroleout(PG_FUNCTION_ARGS); -extern Datum regrolerecv(PG_FUNCTION_ARGS); -extern Datum regrolesend(PG_FUNCTION_ARGS); -extern Datum to_regrole(PG_FUNCTION_ARGS); -extern Datum regnamespacein(PG_FUNCTION_ARGS); -extern Datum regnamespaceout(PG_FUNCTION_ARGS); -extern Datum regnamespacerecv(PG_FUNCTION_ARGS); -extern Datum regnamespacesend(PG_FUNCTION_ARGS); -extern Datum to_regnamespace(PG_FUNCTION_ARGS); -extern Datum regconfigin(PG_FUNCTION_ARGS); -extern Datum regconfigout(PG_FUNCTION_ARGS); -extern Datum regconfigrecv(PG_FUNCTION_ARGS); -extern Datum regconfigsend(PG_FUNCTION_ARGS); -extern Datum regdictionaryin(PG_FUNCTION_ARGS); -extern Datum regdictionaryout(PG_FUNCTION_ARGS); -extern Datum regdictionaryrecv(PG_FUNCTION_ARGS); -extern Datum regdictionarysend(PG_FUNCTION_ARGS); -extern Datum text_regclass(PG_FUNCTION_ARGS); extern List *stringToQualifiedNameList(const char *string); extern char *format_procedure(Oid procedure_oid); extern char *format_procedure_qualified(Oid procedure_oid); @@ -697,113 +85,14 @@ extern char *format_operator_qualified(Oid operator_oid); extern void format_operator_parts(Oid operator_oid, List **objnames, List **objargs); -/* rowtypes.c */ -extern Datum record_in(PG_FUNCTION_ARGS); -extern Datum record_out(PG_FUNCTION_ARGS); -extern Datum record_recv(PG_FUNCTION_ARGS); -extern Datum record_send(PG_FUNCTION_ARGS); -extern Datum record_eq(PG_FUNCTION_ARGS); -extern Datum record_ne(PG_FUNCTION_ARGS); -extern Datum record_lt(PG_FUNCTION_ARGS); -extern Datum record_gt(PG_FUNCTION_ARGS); -extern Datum record_le(PG_FUNCTION_ARGS); -extern Datum record_ge(PG_FUNCTION_ARGS); -extern Datum btrecordcmp(PG_FUNCTION_ARGS); -extern Datum record_image_eq(PG_FUNCTION_ARGS); -extern Datum record_image_ne(PG_FUNCTION_ARGS); -extern Datum record_image_lt(PG_FUNCTION_ARGS); -extern Datum record_image_gt(PG_FUNCTION_ARGS); -extern Datum record_image_le(PG_FUNCTION_ARGS); -extern Datum record_image_ge(PG_FUNCTION_ARGS); -extern Datum btrecordimagecmp(PG_FUNCTION_ARGS); - /* ruleutils.c */ extern bool quote_all_identifiers; -extern Datum pg_get_ruledef(PG_FUNCTION_ARGS); -extern Datum pg_get_ruledef_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_viewdef(PG_FUNCTION_ARGS); -extern Datum pg_get_viewdef_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_viewdef_wrap(PG_FUNCTION_ARGS); -extern Datum pg_get_viewdef_name(PG_FUNCTION_ARGS); -extern Datum pg_get_viewdef_name_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_indexdef(PG_FUNCTION_ARGS); -extern Datum pg_get_partkeydef(PG_FUNCTION_ARGS); -extern Datum pg_get_indexdef_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_triggerdef(PG_FUNCTION_ARGS); -extern Datum pg_get_triggerdef_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_constraintdef(PG_FUNCTION_ARGS); -extern Datum pg_get_constraintdef_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_expr(PG_FUNCTION_ARGS); -extern Datum pg_get_expr_ext(PG_FUNCTION_ARGS); -extern Datum pg_get_userbyid(PG_FUNCTION_ARGS); -extern Datum pg_get_serial_sequence(PG_FUNCTION_ARGS); -extern Datum pg_get_functiondef(PG_FUNCTION_ARGS); -extern Datum pg_get_function_arguments(PG_FUNCTION_ARGS); -extern Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS); -extern Datum pg_get_function_result(PG_FUNCTION_ARGS); -extern Datum pg_get_function_arg_default(PG_FUNCTION_ARGS); extern const char *quote_identifier(const char *ident); extern char *quote_qualified_identifier(const char *qualifier, const char *ident); - -/* tid.c */ -extern Datum tidin(PG_FUNCTION_ARGS); -extern Datum tidout(PG_FUNCTION_ARGS); -extern Datum tidrecv(PG_FUNCTION_ARGS); -extern Datum tidsend(PG_FUNCTION_ARGS); -extern Datum tideq(PG_FUNCTION_ARGS); -extern Datum tidne(PG_FUNCTION_ARGS); -extern Datum tidlt(PG_FUNCTION_ARGS); -extern Datum tidle(PG_FUNCTION_ARGS); -extern Datum tidgt(PG_FUNCTION_ARGS); -extern Datum tidge(PG_FUNCTION_ARGS); -extern Datum bttidcmp(PG_FUNCTION_ARGS); -extern Datum tidlarger(PG_FUNCTION_ARGS); -extern Datum tidsmaller(PG_FUNCTION_ARGS); -extern Datum currtid_byreloid(PG_FUNCTION_ARGS); -extern Datum currtid_byrelname(PG_FUNCTION_ARGS); - /* varchar.c */ -extern Datum bpcharin(PG_FUNCTION_ARGS); -extern Datum bpcharout(PG_FUNCTION_ARGS); -extern Datum bpcharrecv(PG_FUNCTION_ARGS); -extern Datum bpcharsend(PG_FUNCTION_ARGS); -extern Datum bpchartypmodin(PG_FUNCTION_ARGS); -extern Datum bpchartypmodout(PG_FUNCTION_ARGS); -extern Datum bpchar(PG_FUNCTION_ARGS); -extern Datum char_bpchar(PG_FUNCTION_ARGS); -extern Datum name_bpchar(PG_FUNCTION_ARGS); -extern Datum bpchar_name(PG_FUNCTION_ARGS); -extern Datum bpchareq(PG_FUNCTION_ARGS); -extern Datum bpcharne(PG_FUNCTION_ARGS); -extern Datum bpcharlt(PG_FUNCTION_ARGS); -extern Datum bpcharle(PG_FUNCTION_ARGS); -extern Datum bpchargt(PG_FUNCTION_ARGS); -extern Datum bpcharge(PG_FUNCTION_ARGS); -extern Datum bpcharcmp(PG_FUNCTION_ARGS); -extern Datum bpchar_sortsupport(PG_FUNCTION_ARGS); -extern Datum bpchar_larger(PG_FUNCTION_ARGS); -extern Datum bpchar_smaller(PG_FUNCTION_ARGS); extern int bpchartruelen(char *s, int len); -extern Datum bpcharlen(PG_FUNCTION_ARGS); -extern Datum bpcharoctetlen(PG_FUNCTION_ARGS); -extern Datum hashbpchar(PG_FUNCTION_ARGS); -extern Datum bpchar_pattern_lt(PG_FUNCTION_ARGS); -extern Datum bpchar_pattern_le(PG_FUNCTION_ARGS); -extern Datum bpchar_pattern_gt(PG_FUNCTION_ARGS); -extern Datum bpchar_pattern_ge(PG_FUNCTION_ARGS); -extern Datum btbpchar_pattern_cmp(PG_FUNCTION_ARGS); -extern Datum btbpchar_pattern_sortsupport(PG_FUNCTION_ARGS); - -extern Datum varcharin(PG_FUNCTION_ARGS); -extern Datum varcharout(PG_FUNCTION_ARGS); -extern Datum varcharrecv(PG_FUNCTION_ARGS); -extern Datum varcharsend(PG_FUNCTION_ARGS); -extern Datum varchartypmodin(PG_FUNCTION_ARGS); -extern Datum varchartypmodout(PG_FUNCTION_ARGS); -extern Datum varchar_transform(PG_FUNCTION_ARGS); -extern Datum varchar(PG_FUNCTION_ARGS); /* varlena.c */ extern text *cstring_to_text(const char *s); @@ -814,34 +103,6 @@ extern void text_to_cstring_buffer(const text *src, char *dst, size_t dst_len); #define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s)) #define TextDatumGetCString(d) text_to_cstring((text *) DatumGetPointer(d)) -extern Datum textin(PG_FUNCTION_ARGS); -extern Datum textout(PG_FUNCTION_ARGS); -extern Datum textrecv(PG_FUNCTION_ARGS); -extern Datum textsend(PG_FUNCTION_ARGS); -extern Datum textcat(PG_FUNCTION_ARGS); -extern Datum texteq(PG_FUNCTION_ARGS); -extern Datum textne(PG_FUNCTION_ARGS); -extern Datum text_lt(PG_FUNCTION_ARGS); -extern Datum text_le(PG_FUNCTION_ARGS); -extern Datum text_gt(PG_FUNCTION_ARGS); -extern Datum text_ge(PG_FUNCTION_ARGS); -extern Datum text_larger(PG_FUNCTION_ARGS); -extern Datum text_smaller(PG_FUNCTION_ARGS); -extern Datum text_pattern_lt(PG_FUNCTION_ARGS); -extern Datum text_pattern_le(PG_FUNCTION_ARGS); -extern Datum text_pattern_gt(PG_FUNCTION_ARGS); -extern Datum text_pattern_ge(PG_FUNCTION_ARGS); -extern Datum bttext_pattern_cmp(PG_FUNCTION_ARGS); -extern Datum bttext_pattern_sortsupport(PG_FUNCTION_ARGS); -extern Datum textlen(PG_FUNCTION_ARGS); -extern Datum textoctetlen(PG_FUNCTION_ARGS); -extern Datum textpos(PG_FUNCTION_ARGS); -extern Datum text_substr(PG_FUNCTION_ARGS); -extern Datum text_substr_no_len(PG_FUNCTION_ARGS); -extern Datum textoverlay(PG_FUNCTION_ARGS); -extern Datum textoverlay_no_len(PG_FUNCTION_ARGS); -extern Datum name_text(PG_FUNCTION_ARGS); -extern Datum text_name(PG_FUNCTION_ARGS); extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid); extern void varstr_sortsupport(SortSupport ssup, Oid collid, bool bpchar); extern int varstr_levenshtein(const char *source, int slen, @@ -857,89 +118,11 @@ extern bool SplitIdentifierString(char *rawstring, char separator, List **namelist); extern bool SplitDirectoriesString(char *rawstring, char separator, List **namelist); -extern Datum replace_text(PG_FUNCTION_ARGS); extern text *replace_text_regexp(text *src_text, void *regexp, text *replace_text, bool glob); -extern Datum split_text(PG_FUNCTION_ARGS); -extern Datum text_to_array(PG_FUNCTION_ARGS); -extern Datum array_to_text(PG_FUNCTION_ARGS); -extern Datum text_to_array_null(PG_FUNCTION_ARGS); -extern Datum array_to_text_null(PG_FUNCTION_ARGS); -extern Datum to_hex32(PG_FUNCTION_ARGS); -extern Datum to_hex64(PG_FUNCTION_ARGS); -extern Datum md5_text(PG_FUNCTION_ARGS); -extern Datum md5_bytea(PG_FUNCTION_ARGS); - -extern Datum unknownin(PG_FUNCTION_ARGS); -extern Datum unknownout(PG_FUNCTION_ARGS); -extern Datum unknownrecv(PG_FUNCTION_ARGS); -extern Datum unknownsend(PG_FUNCTION_ARGS); - -extern Datum pg_column_size(PG_FUNCTION_ARGS); - -extern Datum bytea_string_agg_transfn(PG_FUNCTION_ARGS); -extern Datum bytea_string_agg_finalfn(PG_FUNCTION_ARGS); -extern Datum string_agg_transfn(PG_FUNCTION_ARGS); -extern Datum string_agg_finalfn(PG_FUNCTION_ARGS); - -extern Datum text_concat(PG_FUNCTION_ARGS); -extern Datum text_concat_ws(PG_FUNCTION_ARGS); -extern Datum text_left(PG_FUNCTION_ARGS); -extern Datum text_right(PG_FUNCTION_ARGS); -extern Datum text_reverse(PG_FUNCTION_ARGS); -extern Datum text_format(PG_FUNCTION_ARGS); -extern Datum text_format_nv(PG_FUNCTION_ARGS); - -/* version.c */ -extern Datum pgsql_version(PG_FUNCTION_ARGS); /* xid.c */ -extern Datum xidin(PG_FUNCTION_ARGS); -extern Datum xidout(PG_FUNCTION_ARGS); -extern Datum xidrecv(PG_FUNCTION_ARGS); -extern Datum xidsend(PG_FUNCTION_ARGS); -extern Datum xideq(PG_FUNCTION_ARGS); -extern Datum xidneq(PG_FUNCTION_ARGS); -extern Datum xid_age(PG_FUNCTION_ARGS); -extern Datum mxid_age(PG_FUNCTION_ARGS); extern int xidComparator(const void *arg1, const void *arg2); -extern Datum cidin(PG_FUNCTION_ARGS); -extern Datum cidout(PG_FUNCTION_ARGS); -extern Datum cidrecv(PG_FUNCTION_ARGS); -extern Datum cidsend(PG_FUNCTION_ARGS); -extern Datum cideq(PG_FUNCTION_ARGS); - -/* like.c */ -extern Datum namelike(PG_FUNCTION_ARGS); -extern Datum namenlike(PG_FUNCTION_ARGS); -extern Datum nameiclike(PG_FUNCTION_ARGS); -extern Datum nameicnlike(PG_FUNCTION_ARGS); -extern Datum textlike(PG_FUNCTION_ARGS); -extern Datum textnlike(PG_FUNCTION_ARGS); -extern Datum texticlike(PG_FUNCTION_ARGS); -extern Datum texticnlike(PG_FUNCTION_ARGS); -extern Datum bytealike(PG_FUNCTION_ARGS); -extern Datum byteanlike(PG_FUNCTION_ARGS); -extern Datum like_escape(PG_FUNCTION_ARGS); -extern Datum like_escape_bytea(PG_FUNCTION_ARGS); - -/* oracle_compat.c */ -extern Datum lower(PG_FUNCTION_ARGS); -extern Datum upper(PG_FUNCTION_ARGS); -extern Datum initcap(PG_FUNCTION_ARGS); -extern Datum lpad(PG_FUNCTION_ARGS); -extern Datum rpad(PG_FUNCTION_ARGS); -extern Datum btrim(PG_FUNCTION_ARGS); -extern Datum btrim1(PG_FUNCTION_ARGS); -extern Datum byteatrim(PG_FUNCTION_ARGS); -extern Datum ltrim(PG_FUNCTION_ARGS); -extern Datum ltrim1(PG_FUNCTION_ARGS); -extern Datum rtrim(PG_FUNCTION_ARGS); -extern Datum rtrim1(PG_FUNCTION_ARGS); -extern Datum translate(PG_FUNCTION_ARGS); -extern Datum chr (PG_FUNCTION_ARGS); -extern Datum repeat(PG_FUNCTION_ARGS); -extern Datum ascii(PG_FUNCTION_ARGS); /* inet_cidr_ntop.c */ extern char *inet_cidr_ntop(int af, const void *src, int bits, @@ -950,385 +133,22 @@ extern int inet_net_pton(int af, const char *src, void *dst, size_t size); /* network.c */ -extern Datum inet_in(PG_FUNCTION_ARGS); -extern Datum inet_out(PG_FUNCTION_ARGS); -extern Datum inet_recv(PG_FUNCTION_ARGS); -extern Datum inet_send(PG_FUNCTION_ARGS); -extern Datum cidr_in(PG_FUNCTION_ARGS); -extern Datum cidr_out(PG_FUNCTION_ARGS); -extern Datum cidr_recv(PG_FUNCTION_ARGS); -extern Datum cidr_send(PG_FUNCTION_ARGS); -extern Datum network_cmp(PG_FUNCTION_ARGS); -extern Datum network_lt(PG_FUNCTION_ARGS); -extern Datum network_le(PG_FUNCTION_ARGS); -extern Datum network_eq(PG_FUNCTION_ARGS); -extern Datum network_ge(PG_FUNCTION_ARGS); -extern Datum network_gt(PG_FUNCTION_ARGS); -extern Datum network_ne(PG_FUNCTION_ARGS); -extern Datum network_smaller(PG_FUNCTION_ARGS); -extern Datum network_larger(PG_FUNCTION_ARGS); -extern Datum hashinet(PG_FUNCTION_ARGS); -extern Datum network_sub(PG_FUNCTION_ARGS); -extern Datum network_subeq(PG_FUNCTION_ARGS); -extern Datum network_sup(PG_FUNCTION_ARGS); -extern Datum network_supeq(PG_FUNCTION_ARGS); -extern Datum network_overlap(PG_FUNCTION_ARGS); -extern Datum network_network(PG_FUNCTION_ARGS); -extern Datum network_netmask(PG_FUNCTION_ARGS); -extern Datum network_hostmask(PG_FUNCTION_ARGS); -extern Datum network_masklen(PG_FUNCTION_ARGS); -extern Datum network_family(PG_FUNCTION_ARGS); -extern Datum network_broadcast(PG_FUNCTION_ARGS); -extern Datum network_host(PG_FUNCTION_ARGS); -extern Datum network_show(PG_FUNCTION_ARGS); -extern Datum inet_abbrev(PG_FUNCTION_ARGS); -extern Datum cidr_abbrev(PG_FUNCTION_ARGS); extern double convert_network_to_scalar(Datum value, Oid typid); -extern Datum inet_to_cidr(PG_FUNCTION_ARGS); -extern Datum inet_set_masklen(PG_FUNCTION_ARGS); -extern Datum cidr_set_masklen(PG_FUNCTION_ARGS); extern Datum network_scan_first(Datum in); extern Datum network_scan_last(Datum in); -extern Datum inet_client_addr(PG_FUNCTION_ARGS); -extern Datum inet_client_port(PG_FUNCTION_ARGS); -extern Datum inet_server_addr(PG_FUNCTION_ARGS); -extern Datum inet_server_port(PG_FUNCTION_ARGS); -extern Datum inetnot(PG_FUNCTION_ARGS); -extern Datum inetand(PG_FUNCTION_ARGS); -extern Datum inetor(PG_FUNCTION_ARGS); -extern Datum inetpl(PG_FUNCTION_ARGS); -extern Datum inetmi_int8(PG_FUNCTION_ARGS); -extern Datum inetmi(PG_FUNCTION_ARGS); extern void clean_ipv6_addr(int addr_family, char *addr); -extern Datum inet_same_family(PG_FUNCTION_ARGS); -extern Datum inet_merge(PG_FUNCTION_ARGS); - -/* mac.c */ -extern Datum macaddr_in(PG_FUNCTION_ARGS); -extern Datum macaddr_out(PG_FUNCTION_ARGS); -extern Datum macaddr_recv(PG_FUNCTION_ARGS); -extern Datum macaddr_send(PG_FUNCTION_ARGS); -extern Datum macaddr_cmp(PG_FUNCTION_ARGS); -extern Datum macaddr_lt(PG_FUNCTION_ARGS); -extern Datum macaddr_le(PG_FUNCTION_ARGS); -extern Datum macaddr_eq(PG_FUNCTION_ARGS); -extern Datum macaddr_ge(PG_FUNCTION_ARGS); -extern Datum macaddr_gt(PG_FUNCTION_ARGS); -extern Datum macaddr_ne(PG_FUNCTION_ARGS); -extern Datum macaddr_not(PG_FUNCTION_ARGS); -extern Datum macaddr_and(PG_FUNCTION_ARGS); -extern Datum macaddr_or(PG_FUNCTION_ARGS); -extern Datum macaddr_trunc(PG_FUNCTION_ARGS); -extern Datum hashmacaddr(PG_FUNCTION_ARGS); /* numeric.c */ -extern Datum numeric_in(PG_FUNCTION_ARGS); -extern Datum numeric_out(PG_FUNCTION_ARGS); -extern Datum numeric_recv(PG_FUNCTION_ARGS); -extern Datum numeric_send(PG_FUNCTION_ARGS); -extern Datum numerictypmodin(PG_FUNCTION_ARGS); -extern Datum numerictypmodout(PG_FUNCTION_ARGS); -extern Datum numeric_transform(PG_FUNCTION_ARGS); -extern Datum numeric (PG_FUNCTION_ARGS); -extern Datum numeric_abs(PG_FUNCTION_ARGS); -extern Datum numeric_uminus(PG_FUNCTION_ARGS); -extern Datum numeric_uplus(PG_FUNCTION_ARGS); -extern Datum numeric_sign(PG_FUNCTION_ARGS); -extern Datum numeric_round(PG_FUNCTION_ARGS); -extern Datum numeric_trunc(PG_FUNCTION_ARGS); -extern Datum numeric_ceil(PG_FUNCTION_ARGS); -extern Datum numeric_floor(PG_FUNCTION_ARGS); -extern Datum numeric_sortsupport(PG_FUNCTION_ARGS); -extern Datum numeric_cmp(PG_FUNCTION_ARGS); -extern Datum numeric_eq(PG_FUNCTION_ARGS); -extern Datum numeric_ne(PG_FUNCTION_ARGS); -extern Datum numeric_gt(PG_FUNCTION_ARGS); -extern Datum numeric_ge(PG_FUNCTION_ARGS); -extern Datum numeric_lt(PG_FUNCTION_ARGS); -extern Datum numeric_le(PG_FUNCTION_ARGS); -extern Datum numeric_add(PG_FUNCTION_ARGS); -extern Datum numeric_sub(PG_FUNCTION_ARGS); -extern Datum numeric_mul(PG_FUNCTION_ARGS); -extern Datum numeric_div(PG_FUNCTION_ARGS); -extern Datum numeric_div_trunc(PG_FUNCTION_ARGS); -extern Datum numeric_mod(PG_FUNCTION_ARGS); -extern Datum numeric_inc(PG_FUNCTION_ARGS); -extern Datum numeric_smaller(PG_FUNCTION_ARGS); -extern Datum numeric_larger(PG_FUNCTION_ARGS); -extern Datum numeric_fac(PG_FUNCTION_ARGS); -extern Datum numeric_sqrt(PG_FUNCTION_ARGS); -extern Datum numeric_exp(PG_FUNCTION_ARGS); -extern Datum numeric_ln(PG_FUNCTION_ARGS); -extern Datum numeric_log(PG_FUNCTION_ARGS); -extern Datum numeric_power(PG_FUNCTION_ARGS); -extern Datum numeric_scale(PG_FUNCTION_ARGS); -extern Datum int4_numeric(PG_FUNCTION_ARGS); -extern Datum numeric_int4(PG_FUNCTION_ARGS); -extern Datum int8_numeric(PG_FUNCTION_ARGS); -extern Datum numeric_int8(PG_FUNCTION_ARGS); -extern Datum int2_numeric(PG_FUNCTION_ARGS); -extern Datum numeric_int2(PG_FUNCTION_ARGS); -extern Datum float8_numeric(PG_FUNCTION_ARGS); -extern Datum numeric_float8(PG_FUNCTION_ARGS); extern Datum numeric_float8_no_overflow(PG_FUNCTION_ARGS); -extern Datum float4_numeric(PG_FUNCTION_ARGS); -extern Datum numeric_float4(PG_FUNCTION_ARGS); -extern Datum numeric_accum(PG_FUNCTION_ARGS); -extern Datum numeric_combine(PG_FUNCTION_ARGS); -extern Datum numeric_avg_accum(PG_FUNCTION_ARGS); -extern Datum numeric_avg_combine(PG_FUNCTION_ARGS); -extern Datum numeric_avg_serialize(PG_FUNCTION_ARGS); -extern Datum numeric_avg_deserialize(PG_FUNCTION_ARGS); -extern Datum numeric_serialize(PG_FUNCTION_ARGS); -extern Datum numeric_deserialize(PG_FUNCTION_ARGS); -extern Datum numeric_accum_inv(PG_FUNCTION_ARGS); -extern Datum int2_accum(PG_FUNCTION_ARGS); -extern Datum int4_accum(PG_FUNCTION_ARGS); -extern Datum int8_accum(PG_FUNCTION_ARGS); -extern Datum numeric_poly_combine(PG_FUNCTION_ARGS); -extern Datum numeric_poly_serialize(PG_FUNCTION_ARGS); -extern Datum numeric_poly_deserialize(PG_FUNCTION_ARGS); -extern Datum int2_accum_inv(PG_FUNCTION_ARGS); -extern Datum int4_accum_inv(PG_FUNCTION_ARGS); -extern Datum int8_accum_inv(PG_FUNCTION_ARGS); -extern Datum int8_avg_accum(PG_FUNCTION_ARGS); -extern Datum int8_avg_combine(PG_FUNCTION_ARGS); -extern Datum int8_avg_serialize(PG_FUNCTION_ARGS); -extern Datum int8_avg_deserialize(PG_FUNCTION_ARGS); -extern Datum numeric_avg(PG_FUNCTION_ARGS); -extern Datum numeric_sum(PG_FUNCTION_ARGS); -extern Datum numeric_var_pop(PG_FUNCTION_ARGS); -extern Datum numeric_var_samp(PG_FUNCTION_ARGS); -extern Datum numeric_stddev_pop(PG_FUNCTION_ARGS); -extern Datum numeric_stddev_samp(PG_FUNCTION_ARGS); -extern Datum numeric_poly_sum(PG_FUNCTION_ARGS); -extern Datum numeric_poly_avg(PG_FUNCTION_ARGS); -extern Datum numeric_poly_var_pop(PG_FUNCTION_ARGS); -extern Datum numeric_poly_var_samp(PG_FUNCTION_ARGS); -extern Datum numeric_poly_stddev_pop(PG_FUNCTION_ARGS); -extern Datum numeric_poly_stddev_samp(PG_FUNCTION_ARGS); -extern Datum int2_sum(PG_FUNCTION_ARGS); -extern Datum int4_sum(PG_FUNCTION_ARGS); -extern Datum int8_sum(PG_FUNCTION_ARGS); -extern Datum int2_avg_accum(PG_FUNCTION_ARGS); -extern Datum int4_avg_accum(PG_FUNCTION_ARGS); -extern Datum int4_avg_combine(PG_FUNCTION_ARGS); -extern Datum int2_avg_accum_inv(PG_FUNCTION_ARGS); -extern Datum int4_avg_accum_inv(PG_FUNCTION_ARGS); -extern Datum int8_avg_accum_inv(PG_FUNCTION_ARGS); -extern Datum int8_avg(PG_FUNCTION_ARGS); -extern Datum int2int4_sum(PG_FUNCTION_ARGS); -extern Datum width_bucket_numeric(PG_FUNCTION_ARGS); -extern Datum hash_numeric(PG_FUNCTION_ARGS); -extern Datum generate_series_numeric(PG_FUNCTION_ARGS); -extern Datum generate_series_step_numeric(PG_FUNCTION_ARGS); - -/* ri_triggers.c */ -extern Datum RI_FKey_check_ins(PG_FUNCTION_ARGS); -extern Datum RI_FKey_check_upd(PG_FUNCTION_ARGS); -extern Datum RI_FKey_noaction_del(PG_FUNCTION_ARGS); -extern Datum RI_FKey_noaction_upd(PG_FUNCTION_ARGS); -extern Datum RI_FKey_cascade_del(PG_FUNCTION_ARGS); -extern Datum RI_FKey_cascade_upd(PG_FUNCTION_ARGS); -extern Datum RI_FKey_restrict_del(PG_FUNCTION_ARGS); -extern Datum RI_FKey_restrict_upd(PG_FUNCTION_ARGS); -extern Datum RI_FKey_setnull_del(PG_FUNCTION_ARGS); -extern Datum RI_FKey_setnull_upd(PG_FUNCTION_ARGS); -extern Datum RI_FKey_setdefault_del(PG_FUNCTION_ARGS); -extern Datum RI_FKey_setdefault_upd(PG_FUNCTION_ARGS); - -/* trigfuncs.c */ -extern Datum suppress_redundant_updates_trigger(PG_FUNCTION_ARGS); - -/* encoding support functions */ -extern Datum getdatabaseencoding(PG_FUNCTION_ARGS); -extern Datum database_character_set(PG_FUNCTION_ARGS); -extern Datum pg_client_encoding(PG_FUNCTION_ARGS); -extern Datum PG_encoding_to_char(PG_FUNCTION_ARGS); -extern Datum PG_char_to_encoding(PG_FUNCTION_ARGS); -extern Datum PG_character_set_name(PG_FUNCTION_ARGS); -extern Datum PG_character_set_id(PG_FUNCTION_ARGS); -extern Datum pg_convert(PG_FUNCTION_ARGS); -extern Datum pg_convert_to(PG_FUNCTION_ARGS); -extern Datum pg_convert_from(PG_FUNCTION_ARGS); -extern Datum length_in_encoding(PG_FUNCTION_ARGS); -extern Datum pg_encoding_max_length_sql(PG_FUNCTION_ARGS); /* format_type.c */ -extern Datum format_type(PG_FUNCTION_ARGS); extern char *format_type_be(Oid type_oid); extern char *format_type_be_qualified(Oid type_oid); extern char *format_type_with_typemod(Oid type_oid, int32 typemod); extern char *format_type_with_typemod_qualified(Oid type_oid, int32 typemod); -extern Datum oidvectortypes(PG_FUNCTION_ARGS); extern int32 type_maximum_size(Oid type_oid, int32 typemod); /* quote.c */ -extern Datum quote_ident(PG_FUNCTION_ARGS); -extern Datum quote_literal(PG_FUNCTION_ARGS); extern char *quote_literal_cstr(const char *rawstr); -extern Datum quote_nullable(PG_FUNCTION_ARGS); - -/* guc.c */ -extern Datum show_config_by_name(PG_FUNCTION_ARGS); -extern Datum show_config_by_name_missing_ok(PG_FUNCTION_ARGS); -extern Datum set_config_by_name(PG_FUNCTION_ARGS); -extern Datum show_all_settings(PG_FUNCTION_ARGS); -extern Datum show_all_file_settings(PG_FUNCTION_ARGS); - -/* pg_config.c */ -extern Datum pg_config(PG_FUNCTION_ARGS); - -/* pg_controldata.c */ -extern Datum pg_control_checkpoint(PG_FUNCTION_ARGS); -extern Datum pg_control_system(PG_FUNCTION_ARGS); -extern Datum pg_control_init(PG_FUNCTION_ARGS); -extern Datum pg_control_recovery(PG_FUNCTION_ARGS); - -/* rls.c */ -extern Datum row_security_active(PG_FUNCTION_ARGS); -extern Datum row_security_active_name(PG_FUNCTION_ARGS); - -/* lockfuncs.c */ -extern Datum pg_lock_status(PG_FUNCTION_ARGS); -extern Datum pg_blocking_pids(PG_FUNCTION_ARGS); -extern Datum pg_advisory_lock_int8(PG_FUNCTION_ARGS); -extern Datum pg_advisory_xact_lock_int8(PG_FUNCTION_ARGS); -extern Datum pg_advisory_lock_shared_int8(PG_FUNCTION_ARGS); -extern Datum pg_advisory_xact_lock_shared_int8(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_lock_int8(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_xact_lock_int8(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_lock_shared_int8(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_xact_lock_shared_int8(PG_FUNCTION_ARGS); -extern Datum pg_advisory_unlock_int8(PG_FUNCTION_ARGS); -extern Datum pg_advisory_unlock_shared_int8(PG_FUNCTION_ARGS); -extern Datum pg_advisory_lock_int4(PG_FUNCTION_ARGS); -extern Datum pg_advisory_xact_lock_int4(PG_FUNCTION_ARGS); -extern Datum pg_advisory_lock_shared_int4(PG_FUNCTION_ARGS); -extern Datum pg_advisory_xact_lock_shared_int4(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_lock_int4(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_xact_lock_int4(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_lock_shared_int4(PG_FUNCTION_ARGS); -extern Datum pg_try_advisory_xact_lock_shared_int4(PG_FUNCTION_ARGS); -extern Datum pg_advisory_unlock_int4(PG_FUNCTION_ARGS); -extern Datum pg_advisory_unlock_shared_int4(PG_FUNCTION_ARGS); -extern Datum pg_advisory_unlock_all(PG_FUNCTION_ARGS); - -/* txid.c */ -extern Datum txid_snapshot_in(PG_FUNCTION_ARGS); -extern Datum txid_snapshot_out(PG_FUNCTION_ARGS); -extern Datum txid_snapshot_recv(PG_FUNCTION_ARGS); -extern Datum txid_snapshot_send(PG_FUNCTION_ARGS); -extern Datum txid_current(PG_FUNCTION_ARGS); -extern Datum txid_current_if_assigned(PG_FUNCTION_ARGS); -extern Datum txid_current_snapshot(PG_FUNCTION_ARGS); -extern Datum txid_snapshot_xmin(PG_FUNCTION_ARGS); -extern Datum txid_snapshot_xmax(PG_FUNCTION_ARGS); -extern Datum txid_snapshot_xip(PG_FUNCTION_ARGS); -extern Datum txid_visible_in_snapshot(PG_FUNCTION_ARGS); - -/* uuid.c */ -extern Datum uuid_in(PG_FUNCTION_ARGS); -extern Datum uuid_out(PG_FUNCTION_ARGS); -extern Datum uuid_send(PG_FUNCTION_ARGS); -extern Datum uuid_recv(PG_FUNCTION_ARGS); -extern Datum uuid_lt(PG_FUNCTION_ARGS); -extern Datum uuid_le(PG_FUNCTION_ARGS); -extern Datum uuid_eq(PG_FUNCTION_ARGS); -extern Datum uuid_ge(PG_FUNCTION_ARGS); -extern Datum uuid_gt(PG_FUNCTION_ARGS); -extern Datum uuid_ne(PG_FUNCTION_ARGS); -extern Datum uuid_cmp(PG_FUNCTION_ARGS); -extern Datum uuid_sortsupport(PG_FUNCTION_ARGS); -extern Datum uuid_hash(PG_FUNCTION_ARGS); - -/* windowfuncs.c */ -extern Datum window_row_number(PG_FUNCTION_ARGS); -extern Datum window_rank(PG_FUNCTION_ARGS); -extern Datum window_dense_rank(PG_FUNCTION_ARGS); -extern Datum window_percent_rank(PG_FUNCTION_ARGS); -extern Datum window_cume_dist(PG_FUNCTION_ARGS); -extern Datum window_ntile(PG_FUNCTION_ARGS); -extern Datum window_lag(PG_FUNCTION_ARGS); -extern Datum window_lag_with_offset(PG_FUNCTION_ARGS); -extern Datum window_lag_with_offset_and_default(PG_FUNCTION_ARGS); -extern Datum window_lead(PG_FUNCTION_ARGS); -extern Datum window_lead_with_offset(PG_FUNCTION_ARGS); -extern Datum window_lead_with_offset_and_default(PG_FUNCTION_ARGS); -extern Datum window_first_value(PG_FUNCTION_ARGS); -extern Datum window_last_value(PG_FUNCTION_ARGS); -extern Datum window_nth_value(PG_FUNCTION_ARGS); - -/* access/spgist/spgquadtreeproc.c */ -extern Datum spg_quad_config(PG_FUNCTION_ARGS); -extern Datum spg_quad_choose(PG_FUNCTION_ARGS); -extern Datum spg_quad_picksplit(PG_FUNCTION_ARGS); -extern Datum spg_quad_inner_consistent(PG_FUNCTION_ARGS); -extern Datum spg_quad_leaf_consistent(PG_FUNCTION_ARGS); - -/* access/spgist/spgkdtreeproc.c */ -extern Datum spg_kd_config(PG_FUNCTION_ARGS); -extern Datum spg_kd_choose(PG_FUNCTION_ARGS); -extern Datum spg_kd_picksplit(PG_FUNCTION_ARGS); -extern Datum spg_kd_inner_consistent(PG_FUNCTION_ARGS); - -/* access/spgist/spgtextproc.c */ -extern Datum spg_text_config(PG_FUNCTION_ARGS); -extern Datum spg_text_choose(PG_FUNCTION_ARGS); -extern Datum spg_text_picksplit(PG_FUNCTION_ARGS); -extern Datum spg_text_inner_consistent(PG_FUNCTION_ARGS); -extern Datum spg_text_leaf_consistent(PG_FUNCTION_ARGS); - -/* access/gin/ginarrayproc.c */ -extern Datum ginarrayextract(PG_FUNCTION_ARGS); -extern Datum ginarrayextract_2args(PG_FUNCTION_ARGS); -extern Datum ginqueryarrayextract(PG_FUNCTION_ARGS); -extern Datum ginarrayconsistent(PG_FUNCTION_ARGS); -extern Datum ginarraytriconsistent(PG_FUNCTION_ARGS); - -/* access/tablesample/bernoulli.c */ -extern Datum tsm_bernoulli_handler(PG_FUNCTION_ARGS); - -/* access/tablesample/system.c */ -extern Datum tsm_system_handler(PG_FUNCTION_ARGS); - -/* access/transam/twophase.c */ -extern Datum pg_prepared_xact(PG_FUNCTION_ARGS); - -/* access/transam/multixact.c */ -extern Datum pg_get_multixact_members(PG_FUNCTION_ARGS); - -/* access/transam/committs.c */ -extern Datum pg_xact_commit_timestamp(PG_FUNCTION_ARGS); -extern Datum pg_last_committed_xact(PG_FUNCTION_ARGS); - -/* catalogs/dependency.c */ -extern Datum pg_describe_object(PG_FUNCTION_ARGS); -extern Datum pg_identify_object(PG_FUNCTION_ARGS); -extern Datum pg_identify_object_as_address(PG_FUNCTION_ARGS); - -/* catalog/objectaddress.c */ -extern Datum pg_get_object_address(PG_FUNCTION_ARGS); - -/* commands/constraint.c */ -extern Datum unique_key_recheck(PG_FUNCTION_ARGS); - -/* commands/event_trigger.c */ -extern Datum pg_event_trigger_dropped_objects(PG_FUNCTION_ARGS); -extern Datum pg_event_trigger_table_rewrite_oid(PG_FUNCTION_ARGS); -extern Datum pg_event_trigger_table_rewrite_reason(PG_FUNCTION_ARGS); -extern Datum pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS); - -/* commands/extension.c */ -extern Datum pg_available_extensions(PG_FUNCTION_ARGS); -extern Datum pg_available_extension_versions(PG_FUNCTION_ARGS); -extern Datum pg_extension_update_paths(PG_FUNCTION_ARGS); -extern Datum pg_extension_config_dump(PG_FUNCTION_ARGS); - -/* commands/prepare.c */ -extern Datum pg_prepared_statement(PG_FUNCTION_ARGS); - -/* utils/mmgr/portalmem.c */ -extern Datum pg_cursor(PG_FUNCTION_ARGS); #endif /* BUILTINS_H */ diff --git a/src/include/utils/bytea.h b/src/include/utils/bytea.h index 6038873c2d..818e65707f 100644 --- a/src/include/utils/bytea.h +++ b/src/include/utils/bytea.h @@ -25,29 +25,4 @@ typedef enum extern int bytea_output; /* ByteaOutputType, but int for GUC enum */ -/* functions are in utils/adt/varlena.c */ -extern Datum byteain(PG_FUNCTION_ARGS); -extern Datum byteaout(PG_FUNCTION_ARGS); -extern Datum bytearecv(PG_FUNCTION_ARGS); -extern Datum byteasend(PG_FUNCTION_ARGS); -extern Datum byteaoctetlen(PG_FUNCTION_ARGS); -extern Datum byteaGetByte(PG_FUNCTION_ARGS); -extern Datum byteaGetBit(PG_FUNCTION_ARGS); -extern Datum byteaSetByte(PG_FUNCTION_ARGS); -extern Datum byteaSetBit(PG_FUNCTION_ARGS); -extern Datum byteaeq(PG_FUNCTION_ARGS); -extern Datum byteane(PG_FUNCTION_ARGS); -extern Datum bytealt(PG_FUNCTION_ARGS); -extern Datum byteale(PG_FUNCTION_ARGS); -extern Datum byteagt(PG_FUNCTION_ARGS); -extern Datum byteage(PG_FUNCTION_ARGS); -extern Datum byteacmp(PG_FUNCTION_ARGS); -extern Datum bytea_sortsupport(PG_FUNCTION_ARGS); -extern Datum byteacat(PG_FUNCTION_ARGS); -extern Datum byteapos(PG_FUNCTION_ARGS); -extern Datum bytea_substr(PG_FUNCTION_ARGS); -extern Datum bytea_substr_no_len(PG_FUNCTION_ARGS); -extern Datum byteaoverlay(PG_FUNCTION_ARGS); -extern Datum byteaoverlay_no_len(PG_FUNCTION_ARGS); - #endif /* BYTEA_H */ diff --git a/src/include/utils/cash.h b/src/include/utils/cash.h index 3a491f9231..84083677e1 100644 --- a/src/include/utils/cash.h +++ b/src/include/utils/cash.h @@ -22,52 +22,4 @@ typedef int64 Cash; #define PG_GETARG_CASH(n) DatumGetCash(PG_GETARG_DATUM(n)) #define PG_RETURN_CASH(x) return CashGetDatum(x) -extern Datum cash_in(PG_FUNCTION_ARGS); -extern Datum cash_out(PG_FUNCTION_ARGS); -extern Datum cash_recv(PG_FUNCTION_ARGS); -extern Datum cash_send(PG_FUNCTION_ARGS); - -extern Datum cash_eq(PG_FUNCTION_ARGS); -extern Datum cash_ne(PG_FUNCTION_ARGS); -extern Datum cash_lt(PG_FUNCTION_ARGS); -extern Datum cash_le(PG_FUNCTION_ARGS); -extern Datum cash_gt(PG_FUNCTION_ARGS); -extern Datum cash_ge(PG_FUNCTION_ARGS); -extern Datum cash_cmp(PG_FUNCTION_ARGS); - -extern Datum cash_pl(PG_FUNCTION_ARGS); -extern Datum cash_mi(PG_FUNCTION_ARGS); -extern Datum cash_div_cash(PG_FUNCTION_ARGS); - -extern Datum cash_mul_flt8(PG_FUNCTION_ARGS); -extern Datum flt8_mul_cash(PG_FUNCTION_ARGS); -extern Datum cash_div_flt8(PG_FUNCTION_ARGS); - -extern Datum cash_mul_flt4(PG_FUNCTION_ARGS); -extern Datum flt4_mul_cash(PG_FUNCTION_ARGS); -extern Datum cash_div_flt4(PG_FUNCTION_ARGS); - -extern Datum cash_mul_int8(PG_FUNCTION_ARGS); -extern Datum int8_mul_cash(PG_FUNCTION_ARGS); -extern Datum cash_div_int8(PG_FUNCTION_ARGS); - -extern Datum cash_mul_int4(PG_FUNCTION_ARGS); -extern Datum int4_mul_cash(PG_FUNCTION_ARGS); -extern Datum cash_div_int4(PG_FUNCTION_ARGS); - -extern Datum cash_mul_int2(PG_FUNCTION_ARGS); -extern Datum int2_mul_cash(PG_FUNCTION_ARGS); -extern Datum cash_div_int2(PG_FUNCTION_ARGS); - -extern Datum cashlarger(PG_FUNCTION_ARGS); -extern Datum cashsmaller(PG_FUNCTION_ARGS); - -extern Datum cash_words(PG_FUNCTION_ARGS); - -extern Datum cash_numeric(PG_FUNCTION_ARGS); -extern Datum numeric_cash(PG_FUNCTION_ARGS); - -extern Datum int4_cash(PG_FUNCTION_ARGS); -extern Datum int8_cash(PG_FUNCTION_ARGS); - #endif /* CASH_H */ diff --git a/src/include/utils/date.h b/src/include/utils/date.h index b5cc6f3a90..e5c44b98cb 100644 --- a/src/include/utils/date.h +++ b/src/include/utils/date.h @@ -96,117 +96,4 @@ extern DateADT GetSQLCurrentDate(void); extern TimeTzADT *GetSQLCurrentTime(int32 typmod); extern TimeADT GetSQLLocalTime(int32 typmod); -extern Datum date_in(PG_FUNCTION_ARGS); -extern Datum date_out(PG_FUNCTION_ARGS); -extern Datum date_recv(PG_FUNCTION_ARGS); -extern Datum date_send(PG_FUNCTION_ARGS); -extern Datum make_date(PG_FUNCTION_ARGS); -extern Datum date_eq(PG_FUNCTION_ARGS); -extern Datum date_ne(PG_FUNCTION_ARGS); -extern Datum date_lt(PG_FUNCTION_ARGS); -extern Datum date_le(PG_FUNCTION_ARGS); -extern Datum date_gt(PG_FUNCTION_ARGS); -extern Datum date_ge(PG_FUNCTION_ARGS); -extern Datum date_cmp(PG_FUNCTION_ARGS); -extern Datum date_sortsupport(PG_FUNCTION_ARGS); -extern Datum date_finite(PG_FUNCTION_ARGS); -extern Datum date_larger(PG_FUNCTION_ARGS); -extern Datum date_smaller(PG_FUNCTION_ARGS); -extern Datum date_mi(PG_FUNCTION_ARGS); -extern Datum date_pli(PG_FUNCTION_ARGS); -extern Datum date_mii(PG_FUNCTION_ARGS); -extern Datum date_eq_timestamp(PG_FUNCTION_ARGS); -extern Datum date_ne_timestamp(PG_FUNCTION_ARGS); -extern Datum date_lt_timestamp(PG_FUNCTION_ARGS); -extern Datum date_le_timestamp(PG_FUNCTION_ARGS); -extern Datum date_gt_timestamp(PG_FUNCTION_ARGS); -extern Datum date_ge_timestamp(PG_FUNCTION_ARGS); -extern Datum date_cmp_timestamp(PG_FUNCTION_ARGS); -extern Datum date_eq_timestamptz(PG_FUNCTION_ARGS); -extern Datum date_ne_timestamptz(PG_FUNCTION_ARGS); -extern Datum date_lt_timestamptz(PG_FUNCTION_ARGS); -extern Datum date_le_timestamptz(PG_FUNCTION_ARGS); -extern Datum date_gt_timestamptz(PG_FUNCTION_ARGS); -extern Datum date_ge_timestamptz(PG_FUNCTION_ARGS); -extern Datum date_cmp_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_eq_date(PG_FUNCTION_ARGS); -extern Datum timestamp_ne_date(PG_FUNCTION_ARGS); -extern Datum timestamp_lt_date(PG_FUNCTION_ARGS); -extern Datum timestamp_le_date(PG_FUNCTION_ARGS); -extern Datum timestamp_gt_date(PG_FUNCTION_ARGS); -extern Datum timestamp_ge_date(PG_FUNCTION_ARGS); -extern Datum timestamp_cmp_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_eq_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_ne_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_lt_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_le_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_gt_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_ge_date(PG_FUNCTION_ARGS); -extern Datum timestamptz_cmp_date(PG_FUNCTION_ARGS); -extern Datum date_pl_interval(PG_FUNCTION_ARGS); -extern Datum date_mi_interval(PG_FUNCTION_ARGS); -extern Datum date_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamp_date(PG_FUNCTION_ARGS); -extern Datum date_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamptz_date(PG_FUNCTION_ARGS); -extern Datum datetime_timestamp(PG_FUNCTION_ARGS); -extern Datum abstime_date(PG_FUNCTION_ARGS); - -extern Datum time_in(PG_FUNCTION_ARGS); -extern Datum time_out(PG_FUNCTION_ARGS); -extern Datum time_recv(PG_FUNCTION_ARGS); -extern Datum time_send(PG_FUNCTION_ARGS); -extern Datum timetypmodin(PG_FUNCTION_ARGS); -extern Datum timetypmodout(PG_FUNCTION_ARGS); -extern Datum make_time(PG_FUNCTION_ARGS); -extern Datum time_transform(PG_FUNCTION_ARGS); -extern Datum time_scale(PG_FUNCTION_ARGS); -extern Datum time_eq(PG_FUNCTION_ARGS); -extern Datum time_ne(PG_FUNCTION_ARGS); -extern Datum time_lt(PG_FUNCTION_ARGS); -extern Datum time_le(PG_FUNCTION_ARGS); -extern Datum time_gt(PG_FUNCTION_ARGS); -extern Datum time_ge(PG_FUNCTION_ARGS); -extern Datum time_cmp(PG_FUNCTION_ARGS); -extern Datum time_hash(PG_FUNCTION_ARGS); -extern Datum overlaps_time(PG_FUNCTION_ARGS); -extern Datum time_larger(PG_FUNCTION_ARGS); -extern Datum time_smaller(PG_FUNCTION_ARGS); -extern Datum time_mi_time(PG_FUNCTION_ARGS); -extern Datum timestamp_time(PG_FUNCTION_ARGS); -extern Datum timestamptz_time(PG_FUNCTION_ARGS); -extern Datum time_interval(PG_FUNCTION_ARGS); -extern Datum interval_time(PG_FUNCTION_ARGS); -extern Datum time_pl_interval(PG_FUNCTION_ARGS); -extern Datum time_mi_interval(PG_FUNCTION_ARGS); -extern Datum time_part(PG_FUNCTION_ARGS); - -extern Datum timetz_in(PG_FUNCTION_ARGS); -extern Datum timetz_out(PG_FUNCTION_ARGS); -extern Datum timetz_recv(PG_FUNCTION_ARGS); -extern Datum timetz_send(PG_FUNCTION_ARGS); -extern Datum timetztypmodin(PG_FUNCTION_ARGS); -extern Datum timetztypmodout(PG_FUNCTION_ARGS); -extern Datum timetz_scale(PG_FUNCTION_ARGS); -extern Datum timetz_eq(PG_FUNCTION_ARGS); -extern Datum timetz_ne(PG_FUNCTION_ARGS); -extern Datum timetz_lt(PG_FUNCTION_ARGS); -extern Datum timetz_le(PG_FUNCTION_ARGS); -extern Datum timetz_gt(PG_FUNCTION_ARGS); -extern Datum timetz_ge(PG_FUNCTION_ARGS); -extern Datum timetz_cmp(PG_FUNCTION_ARGS); -extern Datum timetz_hash(PG_FUNCTION_ARGS); -extern Datum overlaps_timetz(PG_FUNCTION_ARGS); -extern Datum timetz_larger(PG_FUNCTION_ARGS); -extern Datum timetz_smaller(PG_FUNCTION_ARGS); -extern Datum timetz_time(PG_FUNCTION_ARGS); -extern Datum time_timetz(PG_FUNCTION_ARGS); -extern Datum timestamptz_timetz(PG_FUNCTION_ARGS); -extern Datum datetimetz_timestamptz(PG_FUNCTION_ARGS); -extern Datum timetz_part(PG_FUNCTION_ARGS); -extern Datum timetz_zone(PG_FUNCTION_ARGS); -extern Datum timetz_izone(PG_FUNCTION_ARGS); -extern Datum timetz_pl_interval(PG_FUNCTION_ARGS); -extern Datum timetz_mi_interval(PG_FUNCTION_ARGS); - #endif /* DATE_H */ diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h index a7cc2c57bb..f0e77982ce 100644 --- a/src/include/utils/datetime.h +++ b/src/include/utils/datetime.h @@ -346,7 +346,4 @@ extern TimeZoneAbbrevTable *ConvertTimeZoneAbbrevs(struct tzEntry *abbrevs, int n); extern void InstallTimeZoneAbbrevs(TimeZoneAbbrevTable *tbl); -extern Datum pg_timezone_abbrevs(PG_FUNCTION_ARGS); -extern Datum pg_timezone_names(PG_FUNCTION_ARGS); - #endif /* DATETIME_H */ diff --git a/src/include/utils/formatting.h b/src/include/utils/formatting.h index d920bed479..8eaf2c3052 100644 --- a/src/include/utils/formatting.h +++ b/src/include/utils/formatting.h @@ -28,16 +28,4 @@ extern char *asc_tolower(const char *buff, size_t nbytes); extern char *asc_toupper(const char *buff, size_t nbytes); extern char *asc_initcap(const char *buff, size_t nbytes); -extern Datum timestamp_to_char(PG_FUNCTION_ARGS); -extern Datum timestamptz_to_char(PG_FUNCTION_ARGS); -extern Datum interval_to_char(PG_FUNCTION_ARGS); -extern Datum to_timestamp(PG_FUNCTION_ARGS); -extern Datum to_date(PG_FUNCTION_ARGS); -extern Datum numeric_to_number(PG_FUNCTION_ARGS); -extern Datum numeric_to_char(PG_FUNCTION_ARGS); -extern Datum int4_to_char(PG_FUNCTION_ARGS); -extern Datum int8_to_char(PG_FUNCTION_ARGS); -extern Datum float4_to_char(PG_FUNCTION_ARGS); -extern Datum float8_to_char(PG_FUNCTION_ARGS); - #endif diff --git a/src/include/utils/geo_decls.h b/src/include/utils/geo_decls.h index e7477b03b0..9b530dbe3d 100644 --- a/src/include/utils/geo_decls.h +++ b/src/include/utils/geo_decls.h @@ -175,270 +175,12 @@ typedef struct /* - * in geo_ops.h + * in geo_ops.c */ -/* public point routines */ -extern Datum point_in(PG_FUNCTION_ARGS); -extern Datum point_out(PG_FUNCTION_ARGS); -extern Datum point_recv(PG_FUNCTION_ARGS); -extern Datum point_send(PG_FUNCTION_ARGS); -extern Datum construct_point(PG_FUNCTION_ARGS); -extern Datum point_left(PG_FUNCTION_ARGS); -extern Datum point_right(PG_FUNCTION_ARGS); -extern Datum point_above(PG_FUNCTION_ARGS); -extern Datum point_below(PG_FUNCTION_ARGS); -extern Datum point_vert(PG_FUNCTION_ARGS); -extern Datum point_horiz(PG_FUNCTION_ARGS); -extern Datum point_eq(PG_FUNCTION_ARGS); -extern Datum point_ne(PG_FUNCTION_ARGS); -extern Datum point_distance(PG_FUNCTION_ARGS); -extern Datum point_slope(PG_FUNCTION_ARGS); -extern Datum point_add(PG_FUNCTION_ARGS); -extern Datum point_sub(PG_FUNCTION_ARGS); -extern Datum point_mul(PG_FUNCTION_ARGS); -extern Datum point_div(PG_FUNCTION_ARGS); - -/* private routines */ +/* private point routines */ extern double point_dt(Point *pt1, Point *pt2); extern double point_sl(Point *pt1, Point *pt2); extern double pg_hypot(double x, double y); -/* public lseg routines */ -extern Datum lseg_in(PG_FUNCTION_ARGS); -extern Datum lseg_out(PG_FUNCTION_ARGS); -extern Datum lseg_recv(PG_FUNCTION_ARGS); -extern Datum lseg_send(PG_FUNCTION_ARGS); -extern Datum lseg_intersect(PG_FUNCTION_ARGS); -extern Datum lseg_parallel(PG_FUNCTION_ARGS); -extern Datum lseg_perp(PG_FUNCTION_ARGS); -extern Datum lseg_vertical(PG_FUNCTION_ARGS); -extern Datum lseg_horizontal(PG_FUNCTION_ARGS); -extern Datum lseg_eq(PG_FUNCTION_ARGS); -extern Datum lseg_ne(PG_FUNCTION_ARGS); -extern Datum lseg_lt(PG_FUNCTION_ARGS); -extern Datum lseg_le(PG_FUNCTION_ARGS); -extern Datum lseg_gt(PG_FUNCTION_ARGS); -extern Datum lseg_ge(PG_FUNCTION_ARGS); -extern Datum lseg_construct(PG_FUNCTION_ARGS); -extern Datum lseg_length(PG_FUNCTION_ARGS); -extern Datum lseg_distance(PG_FUNCTION_ARGS); -extern Datum lseg_center(PG_FUNCTION_ARGS); -extern Datum lseg_interpt(PG_FUNCTION_ARGS); -extern Datum dist_pl(PG_FUNCTION_ARGS); -extern Datum dist_ps(PG_FUNCTION_ARGS); -extern Datum dist_ppath(PG_FUNCTION_ARGS); -extern Datum dist_pb(PG_FUNCTION_ARGS); -extern Datum dist_sl(PG_FUNCTION_ARGS); -extern Datum dist_sb(PG_FUNCTION_ARGS); -extern Datum dist_lb(PG_FUNCTION_ARGS); -extern Datum close_lseg(PG_FUNCTION_ARGS); -extern Datum close_pl(PG_FUNCTION_ARGS); -extern Datum close_ps(PG_FUNCTION_ARGS); -extern Datum close_pb(PG_FUNCTION_ARGS); -extern Datum close_sl(PG_FUNCTION_ARGS); -extern Datum close_sb(PG_FUNCTION_ARGS); -extern Datum close_ls(PG_FUNCTION_ARGS); -extern Datum close_lb(PG_FUNCTION_ARGS); -extern Datum on_pl(PG_FUNCTION_ARGS); -extern Datum on_ps(PG_FUNCTION_ARGS); -extern Datum on_pb(PG_FUNCTION_ARGS); -extern Datum on_ppath(PG_FUNCTION_ARGS); -extern Datum on_sl(PG_FUNCTION_ARGS); -extern Datum on_sb(PG_FUNCTION_ARGS); -extern Datum inter_sl(PG_FUNCTION_ARGS); -extern Datum inter_sb(PG_FUNCTION_ARGS); -extern Datum inter_lb(PG_FUNCTION_ARGS); - -/* public line routines */ -extern Datum line_in(PG_FUNCTION_ARGS); -extern Datum line_out(PG_FUNCTION_ARGS); -extern Datum line_recv(PG_FUNCTION_ARGS); -extern Datum line_send(PG_FUNCTION_ARGS); -extern Datum line_interpt(PG_FUNCTION_ARGS); -extern Datum line_distance(PG_FUNCTION_ARGS); -extern Datum line_construct_pp(PG_FUNCTION_ARGS); -extern Datum line_intersect(PG_FUNCTION_ARGS); -extern Datum line_parallel(PG_FUNCTION_ARGS); -extern Datum line_perp(PG_FUNCTION_ARGS); -extern Datum line_vertical(PG_FUNCTION_ARGS); -extern Datum line_horizontal(PG_FUNCTION_ARGS); -extern Datum line_eq(PG_FUNCTION_ARGS); - -/* public box routines */ -extern Datum box_in(PG_FUNCTION_ARGS); -extern Datum box_out(PG_FUNCTION_ARGS); -extern Datum box_recv(PG_FUNCTION_ARGS); -extern Datum box_send(PG_FUNCTION_ARGS); -extern Datum box_same(PG_FUNCTION_ARGS); -extern Datum box_overlap(PG_FUNCTION_ARGS); -extern Datum box_left(PG_FUNCTION_ARGS); -extern Datum box_overleft(PG_FUNCTION_ARGS); -extern Datum box_right(PG_FUNCTION_ARGS); -extern Datum box_overright(PG_FUNCTION_ARGS); -extern Datum box_below(PG_FUNCTION_ARGS); -extern Datum box_overbelow(PG_FUNCTION_ARGS); -extern Datum box_above(PG_FUNCTION_ARGS); -extern Datum box_overabove(PG_FUNCTION_ARGS); -extern Datum box_contained(PG_FUNCTION_ARGS); -extern Datum box_contain(PG_FUNCTION_ARGS); -extern Datum box_contain_pt(PG_FUNCTION_ARGS); -extern Datum box_below_eq(PG_FUNCTION_ARGS); -extern Datum box_above_eq(PG_FUNCTION_ARGS); -extern Datum box_lt(PG_FUNCTION_ARGS); -extern Datum box_gt(PG_FUNCTION_ARGS); -extern Datum box_eq(PG_FUNCTION_ARGS); -extern Datum box_le(PG_FUNCTION_ARGS); -extern Datum box_ge(PG_FUNCTION_ARGS); -extern Datum box_area(PG_FUNCTION_ARGS); -extern Datum box_width(PG_FUNCTION_ARGS); -extern Datum box_height(PG_FUNCTION_ARGS); -extern Datum box_distance(PG_FUNCTION_ARGS); -extern Datum box_center(PG_FUNCTION_ARGS); -extern Datum box_intersect(PG_FUNCTION_ARGS); -extern Datum box_diagonal(PG_FUNCTION_ARGS); -extern Datum points_box(PG_FUNCTION_ARGS); -extern Datum box_add(PG_FUNCTION_ARGS); -extern Datum box_sub(PG_FUNCTION_ARGS); -extern Datum box_mul(PG_FUNCTION_ARGS); -extern Datum box_div(PG_FUNCTION_ARGS); -extern Datum point_box(PG_FUNCTION_ARGS); -extern Datum boxes_bound_box(PG_FUNCTION_ARGS); - -/* public path routines */ -extern Datum path_area(PG_FUNCTION_ARGS); -extern Datum path_in(PG_FUNCTION_ARGS); -extern Datum path_out(PG_FUNCTION_ARGS); -extern Datum path_recv(PG_FUNCTION_ARGS); -extern Datum path_send(PG_FUNCTION_ARGS); -extern Datum path_n_lt(PG_FUNCTION_ARGS); -extern Datum path_n_gt(PG_FUNCTION_ARGS); -extern Datum path_n_eq(PG_FUNCTION_ARGS); -extern Datum path_n_le(PG_FUNCTION_ARGS); -extern Datum path_n_ge(PG_FUNCTION_ARGS); -extern Datum path_inter(PG_FUNCTION_ARGS); -extern Datum path_distance(PG_FUNCTION_ARGS); -extern Datum path_length(PG_FUNCTION_ARGS); - -extern Datum path_isclosed(PG_FUNCTION_ARGS); -extern Datum path_isopen(PG_FUNCTION_ARGS); -extern Datum path_npoints(PG_FUNCTION_ARGS); - -extern Datum path_close(PG_FUNCTION_ARGS); -extern Datum path_open(PG_FUNCTION_ARGS); -extern Datum path_add(PG_FUNCTION_ARGS); -extern Datum path_add_pt(PG_FUNCTION_ARGS); -extern Datum path_sub_pt(PG_FUNCTION_ARGS); -extern Datum path_mul_pt(PG_FUNCTION_ARGS); -extern Datum path_div_pt(PG_FUNCTION_ARGS); - -extern Datum path_center(PG_FUNCTION_ARGS); -extern Datum path_poly(PG_FUNCTION_ARGS); - -/* public polygon routines */ -extern Datum poly_in(PG_FUNCTION_ARGS); -extern Datum poly_out(PG_FUNCTION_ARGS); -extern Datum poly_recv(PG_FUNCTION_ARGS); -extern Datum poly_send(PG_FUNCTION_ARGS); -extern Datum poly_left(PG_FUNCTION_ARGS); -extern Datum poly_overleft(PG_FUNCTION_ARGS); -extern Datum poly_right(PG_FUNCTION_ARGS); -extern Datum poly_overright(PG_FUNCTION_ARGS); -extern Datum poly_below(PG_FUNCTION_ARGS); -extern Datum poly_overbelow(PG_FUNCTION_ARGS); -extern Datum poly_above(PG_FUNCTION_ARGS); -extern Datum poly_overabove(PG_FUNCTION_ARGS); -extern Datum poly_same(PG_FUNCTION_ARGS); -extern Datum poly_overlap(PG_FUNCTION_ARGS); -extern Datum poly_contain(PG_FUNCTION_ARGS); -extern Datum poly_contained(PG_FUNCTION_ARGS); -extern Datum poly_contain_pt(PG_FUNCTION_ARGS); -extern Datum pt_contained_poly(PG_FUNCTION_ARGS); -extern Datum poly_distance(PG_FUNCTION_ARGS); -extern Datum poly_npoints(PG_FUNCTION_ARGS); -extern Datum poly_center(PG_FUNCTION_ARGS); -extern Datum poly_box(PG_FUNCTION_ARGS); -extern Datum poly_path(PG_FUNCTION_ARGS); -extern Datum box_poly(PG_FUNCTION_ARGS); - -/* public circle routines */ -extern Datum circle_in(PG_FUNCTION_ARGS); -extern Datum circle_out(PG_FUNCTION_ARGS); -extern Datum circle_recv(PG_FUNCTION_ARGS); -extern Datum circle_send(PG_FUNCTION_ARGS); -extern Datum circle_same(PG_FUNCTION_ARGS); -extern Datum circle_overlap(PG_FUNCTION_ARGS); -extern Datum circle_overleft(PG_FUNCTION_ARGS); -extern Datum circle_left(PG_FUNCTION_ARGS); -extern Datum circle_right(PG_FUNCTION_ARGS); -extern Datum circle_overright(PG_FUNCTION_ARGS); -extern Datum circle_contained(PG_FUNCTION_ARGS); -extern Datum circle_contain(PG_FUNCTION_ARGS); -extern Datum circle_below(PG_FUNCTION_ARGS); -extern Datum circle_above(PG_FUNCTION_ARGS); -extern Datum circle_overbelow(PG_FUNCTION_ARGS); -extern Datum circle_overabove(PG_FUNCTION_ARGS); -extern Datum circle_eq(PG_FUNCTION_ARGS); -extern Datum circle_ne(PG_FUNCTION_ARGS); -extern Datum circle_lt(PG_FUNCTION_ARGS); -extern Datum circle_gt(PG_FUNCTION_ARGS); -extern Datum circle_le(PG_FUNCTION_ARGS); -extern Datum circle_ge(PG_FUNCTION_ARGS); -extern Datum circle_contain_pt(PG_FUNCTION_ARGS); -extern Datum pt_contained_circle(PG_FUNCTION_ARGS); -extern Datum circle_add_pt(PG_FUNCTION_ARGS); -extern Datum circle_sub_pt(PG_FUNCTION_ARGS); -extern Datum circle_mul_pt(PG_FUNCTION_ARGS); -extern Datum circle_div_pt(PG_FUNCTION_ARGS); -extern Datum circle_diameter(PG_FUNCTION_ARGS); -extern Datum circle_radius(PG_FUNCTION_ARGS); -extern Datum circle_distance(PG_FUNCTION_ARGS); -extern Datum dist_pc(PG_FUNCTION_ARGS); -extern Datum dist_cpoint(PG_FUNCTION_ARGS); -extern Datum dist_cpoly(PG_FUNCTION_ARGS); -extern Datum dist_ppoly(PG_FUNCTION_ARGS); -extern Datum dist_polyp(PG_FUNCTION_ARGS); -extern Datum circle_center(PG_FUNCTION_ARGS); -extern Datum cr_circle(PG_FUNCTION_ARGS); -extern Datum box_circle(PG_FUNCTION_ARGS); -extern Datum circle_box(PG_FUNCTION_ARGS); -extern Datum poly_circle(PG_FUNCTION_ARGS); -extern Datum circle_poly(PG_FUNCTION_ARGS); -extern Datum circle_area(PG_FUNCTION_ARGS); - -/* support routines for the GiST access method (access/gist/gistproc.c) */ -extern Datum gist_box_compress(PG_FUNCTION_ARGS); -extern Datum gist_box_decompress(PG_FUNCTION_ARGS); -extern Datum gist_box_union(PG_FUNCTION_ARGS); -extern Datum gist_box_picksplit(PG_FUNCTION_ARGS); -extern Datum gist_box_consistent(PG_FUNCTION_ARGS); -extern Datum gist_box_penalty(PG_FUNCTION_ARGS); -extern Datum gist_box_same(PG_FUNCTION_ARGS); -extern Datum gist_box_fetch(PG_FUNCTION_ARGS); -extern Datum gist_poly_compress(PG_FUNCTION_ARGS); -extern Datum gist_poly_consistent(PG_FUNCTION_ARGS); -extern Datum gist_poly_distance(PG_FUNCTION_ARGS); -extern Datum gist_circle_compress(PG_FUNCTION_ARGS); -extern Datum gist_circle_consistent(PG_FUNCTION_ARGS); -extern Datum gist_circle_distance(PG_FUNCTION_ARGS); -extern Datum gist_point_compress(PG_FUNCTION_ARGS); -extern Datum gist_point_consistent(PG_FUNCTION_ARGS); -extern Datum gist_point_distance(PG_FUNCTION_ARGS); -extern Datum gist_point_fetch(PG_FUNCTION_ARGS); - -/* utils/adt/geo_spgist.c */ -Datum spg_box_quad_config(PG_FUNCTION_ARGS); -Datum spg_box_quad_choose(PG_FUNCTION_ARGS); -Datum spg_box_quad_picksplit(PG_FUNCTION_ARGS); -Datum spg_box_quad_inner_consistent(PG_FUNCTION_ARGS); -Datum spg_box_quad_leaf_consistent(PG_FUNCTION_ARGS); - -/* geo_selfuncs.c */ -extern Datum areasel(PG_FUNCTION_ARGS); -extern Datum areajoinsel(PG_FUNCTION_ARGS); -extern Datum positionsel(PG_FUNCTION_ARGS); -extern Datum positionjoinsel(PG_FUNCTION_ARGS); -extern Datum contsel(PG_FUNCTION_ARGS); -extern Datum contjoinsel(PG_FUNCTION_ARGS); - #endif /* GEO_DECLS_H */ diff --git a/src/include/utils/inet.h b/src/include/utils/inet.h index f6d4072334..577b34dbf9 100644 --- a/src/include/utils/inet.h +++ b/src/include/utils/inet.h @@ -123,31 +123,4 @@ extern inet *cidr_set_masklen_internal(const inet *src, int bits); extern int bitncmp(const unsigned char *l, const unsigned char *r, int n); extern int bitncommon(const unsigned char *l, const unsigned char *r, int n); -/* - * GiST support functions in network_gist.c - */ -extern Datum inet_gist_fetch(PG_FUNCTION_ARGS); -extern Datum inet_gist_consistent(PG_FUNCTION_ARGS); -extern Datum inet_gist_union(PG_FUNCTION_ARGS); -extern Datum inet_gist_compress(PG_FUNCTION_ARGS); -extern Datum inet_gist_decompress(PG_FUNCTION_ARGS); -extern Datum inet_gist_penalty(PG_FUNCTION_ARGS); -extern Datum inet_gist_picksplit(PG_FUNCTION_ARGS); -extern Datum inet_gist_same(PG_FUNCTION_ARGS); - -/* - * SP-GiST support functions in network_spgist.c - */ -extern Datum inet_spg_config(PG_FUNCTION_ARGS); -extern Datum inet_spg_choose(PG_FUNCTION_ARGS); -extern Datum inet_spg_picksplit(PG_FUNCTION_ARGS); -extern Datum inet_spg_inner_consistent(PG_FUNCTION_ARGS); -extern Datum inet_spg_leaf_consistent(PG_FUNCTION_ARGS); - -/* - * Estimation functions in network_selfuncs.c - */ -extern Datum networksel(PG_FUNCTION_ARGS); -extern Datum networkjoinsel(PG_FUNCTION_ARGS); - #endif /* INET_H */ diff --git a/src/include/utils/int8.h b/src/include/utils/int8.h index 627505e6aa..c58ee048cf 100644 --- a/src/include/utils/int8.h +++ b/src/include/utils/int8.h @@ -20,110 +20,6 @@ #ifndef INT8_H #define INT8_H -#include "fmgr.h" - - extern bool scanint8(const char *str, bool errorOK, int64 *result); -extern Datum int8in(PG_FUNCTION_ARGS); -extern Datum int8out(PG_FUNCTION_ARGS); -extern Datum int8recv(PG_FUNCTION_ARGS); -extern Datum int8send(PG_FUNCTION_ARGS); - -extern Datum int8eq(PG_FUNCTION_ARGS); -extern Datum int8ne(PG_FUNCTION_ARGS); -extern Datum int8lt(PG_FUNCTION_ARGS); -extern Datum int8gt(PG_FUNCTION_ARGS); -extern Datum int8le(PG_FUNCTION_ARGS); -extern Datum int8ge(PG_FUNCTION_ARGS); - -extern Datum int84eq(PG_FUNCTION_ARGS); -extern Datum int84ne(PG_FUNCTION_ARGS); -extern Datum int84lt(PG_FUNCTION_ARGS); -extern Datum int84gt(PG_FUNCTION_ARGS); -extern Datum int84le(PG_FUNCTION_ARGS); -extern Datum int84ge(PG_FUNCTION_ARGS); - -extern Datum int48eq(PG_FUNCTION_ARGS); -extern Datum int48ne(PG_FUNCTION_ARGS); -extern Datum int48lt(PG_FUNCTION_ARGS); -extern Datum int48gt(PG_FUNCTION_ARGS); -extern Datum int48le(PG_FUNCTION_ARGS); -extern Datum int48ge(PG_FUNCTION_ARGS); - -extern Datum int82eq(PG_FUNCTION_ARGS); -extern Datum int82ne(PG_FUNCTION_ARGS); -extern Datum int82lt(PG_FUNCTION_ARGS); -extern Datum int82gt(PG_FUNCTION_ARGS); -extern Datum int82le(PG_FUNCTION_ARGS); -extern Datum int82ge(PG_FUNCTION_ARGS); - -extern Datum int28eq(PG_FUNCTION_ARGS); -extern Datum int28ne(PG_FUNCTION_ARGS); -extern Datum int28lt(PG_FUNCTION_ARGS); -extern Datum int28gt(PG_FUNCTION_ARGS); -extern Datum int28le(PG_FUNCTION_ARGS); -extern Datum int28ge(PG_FUNCTION_ARGS); - -extern Datum int8um(PG_FUNCTION_ARGS); -extern Datum int8up(PG_FUNCTION_ARGS); -extern Datum int8pl(PG_FUNCTION_ARGS); -extern Datum int8mi(PG_FUNCTION_ARGS); -extern Datum int8mul(PG_FUNCTION_ARGS); -extern Datum int8div(PG_FUNCTION_ARGS); -extern Datum int8abs(PG_FUNCTION_ARGS); -extern Datum int8mod(PG_FUNCTION_ARGS); -extern Datum int8inc(PG_FUNCTION_ARGS); -extern Datum int8dec(PG_FUNCTION_ARGS); -extern Datum int8inc_any(PG_FUNCTION_ARGS); -extern Datum int8inc_float8_float8(PG_FUNCTION_ARGS); -extern Datum int8dec_any(PG_FUNCTION_ARGS); -extern Datum int8larger(PG_FUNCTION_ARGS); -extern Datum int8smaller(PG_FUNCTION_ARGS); - -extern Datum int8and(PG_FUNCTION_ARGS); -extern Datum int8or(PG_FUNCTION_ARGS); -extern Datum int8xor(PG_FUNCTION_ARGS); -extern Datum int8not(PG_FUNCTION_ARGS); -extern Datum int8shl(PG_FUNCTION_ARGS); -extern Datum int8shr(PG_FUNCTION_ARGS); - -extern Datum int84pl(PG_FUNCTION_ARGS); -extern Datum int84mi(PG_FUNCTION_ARGS); -extern Datum int84mul(PG_FUNCTION_ARGS); -extern Datum int84div(PG_FUNCTION_ARGS); - -extern Datum int48pl(PG_FUNCTION_ARGS); -extern Datum int48mi(PG_FUNCTION_ARGS); -extern Datum int48mul(PG_FUNCTION_ARGS); -extern Datum int48div(PG_FUNCTION_ARGS); - -extern Datum int82pl(PG_FUNCTION_ARGS); -extern Datum int82mi(PG_FUNCTION_ARGS); -extern Datum int82mul(PG_FUNCTION_ARGS); -extern Datum int82div(PG_FUNCTION_ARGS); - -extern Datum int28pl(PG_FUNCTION_ARGS); -extern Datum int28mi(PG_FUNCTION_ARGS); -extern Datum int28mul(PG_FUNCTION_ARGS); -extern Datum int28div(PG_FUNCTION_ARGS); - -extern Datum int48(PG_FUNCTION_ARGS); -extern Datum int84(PG_FUNCTION_ARGS); - -extern Datum int28(PG_FUNCTION_ARGS); -extern Datum int82(PG_FUNCTION_ARGS); - -extern Datum i8tod(PG_FUNCTION_ARGS); -extern Datum dtoi8(PG_FUNCTION_ARGS); - -extern Datum i8tof(PG_FUNCTION_ARGS); -extern Datum ftoi8(PG_FUNCTION_ARGS); - -extern Datum i8tooid(PG_FUNCTION_ARGS); -extern Datum oidtoi8(PG_FUNCTION_ARGS); - -extern Datum generate_series_int8(PG_FUNCTION_ARGS); -extern Datum generate_series_step_int8(PG_FUNCTION_ARGS); - #endif /* INT8_H */ diff --git a/src/include/utils/json.h b/src/include/utils/json.h index 7f3e653455..0a749b90c8 100644 --- a/src/include/utils/json.h +++ b/src/include/utils/json.h @@ -14,73 +14,9 @@ #ifndef JSON_H #define JSON_H -#include "fmgr.h" #include "lib/stringinfo.h" /* functions in json.c */ -extern Datum json_in(PG_FUNCTION_ARGS); -extern Datum json_out(PG_FUNCTION_ARGS); -extern Datum json_recv(PG_FUNCTION_ARGS); -extern Datum json_send(PG_FUNCTION_ARGS); -extern Datum array_to_json(PG_FUNCTION_ARGS); -extern Datum array_to_json_pretty(PG_FUNCTION_ARGS); -extern Datum row_to_json(PG_FUNCTION_ARGS); -extern Datum row_to_json_pretty(PG_FUNCTION_ARGS); -extern Datum to_json(PG_FUNCTION_ARGS); - -extern Datum json_agg_transfn(PG_FUNCTION_ARGS); -extern Datum json_agg_finalfn(PG_FUNCTION_ARGS); - -extern Datum json_object_agg_finalfn(PG_FUNCTION_ARGS); -extern Datum json_object_agg_transfn(PG_FUNCTION_ARGS); - -extern Datum json_build_object(PG_FUNCTION_ARGS); -extern Datum json_build_object_noargs(PG_FUNCTION_ARGS); -extern Datum json_build_array(PG_FUNCTION_ARGS); -extern Datum json_build_array_noargs(PG_FUNCTION_ARGS); - -extern Datum json_object(PG_FUNCTION_ARGS); -extern Datum json_object_two_arg(PG_FUNCTION_ARGS); - extern void escape_json(StringInfo buf, const char *str); -extern Datum json_typeof(PG_FUNCTION_ARGS); - -/* functions in jsonfuncs.c */ -extern Datum json_object_field(PG_FUNCTION_ARGS); -extern Datum json_object_field_text(PG_FUNCTION_ARGS); -extern Datum json_array_element(PG_FUNCTION_ARGS); -extern Datum json_array_element_text(PG_FUNCTION_ARGS); -extern Datum json_extract_path(PG_FUNCTION_ARGS); -extern Datum json_extract_path_text(PG_FUNCTION_ARGS); -extern Datum json_object_keys(PG_FUNCTION_ARGS); -extern Datum json_array_length(PG_FUNCTION_ARGS); -extern Datum json_each(PG_FUNCTION_ARGS); -extern Datum json_each_text(PG_FUNCTION_ARGS); -extern Datum json_array_elements(PG_FUNCTION_ARGS); -extern Datum json_array_elements_text(PG_FUNCTION_ARGS); -extern Datum json_populate_record(PG_FUNCTION_ARGS); -extern Datum json_populate_recordset(PG_FUNCTION_ARGS); -extern Datum json_to_record(PG_FUNCTION_ARGS); -extern Datum json_to_recordset(PG_FUNCTION_ARGS); -extern Datum json_strip_nulls(PG_FUNCTION_ARGS); - -extern Datum jsonb_object_field(PG_FUNCTION_ARGS); -extern Datum jsonb_object_field_text(PG_FUNCTION_ARGS); -extern Datum jsonb_array_element(PG_FUNCTION_ARGS); -extern Datum jsonb_array_element_text(PG_FUNCTION_ARGS); -extern Datum jsonb_extract_path(PG_FUNCTION_ARGS); -extern Datum jsonb_extract_path_text(PG_FUNCTION_ARGS); -extern Datum jsonb_object_keys(PG_FUNCTION_ARGS); -extern Datum jsonb_array_length(PG_FUNCTION_ARGS); -extern Datum jsonb_each(PG_FUNCTION_ARGS); -extern Datum jsonb_each_text(PG_FUNCTION_ARGS); -extern Datum jsonb_array_elements_text(PG_FUNCTION_ARGS); -extern Datum jsonb_array_elements(PG_FUNCTION_ARGS); -extern Datum jsonb_populate_record(PG_FUNCTION_ARGS); -extern Datum jsonb_populate_recordset(PG_FUNCTION_ARGS); -extern Datum jsonb_to_record(PG_FUNCTION_ARGS); -extern Datum jsonb_to_recordset(PG_FUNCTION_ARGS); -extern Datum jsonb_strip_nulls(PG_FUNCTION_ARGS); - #endif /* JSON_H */ diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h index ad24a98cd2..e402b9e3a7 100644 --- a/src/include/utils/jsonb.h +++ b/src/include/utils/jsonb.h @@ -345,73 +345,6 @@ typedef struct JsonbIterator struct JsonbIterator *parent; } JsonbIterator; -/* I/O routines */ -extern Datum jsonb_in(PG_FUNCTION_ARGS); -extern Datum jsonb_out(PG_FUNCTION_ARGS); -extern Datum jsonb_recv(PG_FUNCTION_ARGS); -extern Datum jsonb_send(PG_FUNCTION_ARGS); -extern Datum jsonb_typeof(PG_FUNCTION_ARGS); - -/* generator routines */ -extern Datum to_jsonb(PG_FUNCTION_ARGS); - -extern Datum jsonb_build_object(PG_FUNCTION_ARGS); -extern Datum jsonb_build_object_noargs(PG_FUNCTION_ARGS); -extern Datum jsonb_build_array(PG_FUNCTION_ARGS); -extern Datum jsonb_build_array_noargs(PG_FUNCTION_ARGS); -extern Datum jsonb_object(PG_FUNCTION_ARGS); -extern Datum jsonb_object_two_arg(PG_FUNCTION_ARGS); - -/* jsonb_agg, json_object_agg functions */ -extern Datum jsonb_agg_transfn(PG_FUNCTION_ARGS); -extern Datum jsonb_agg_finalfn(PG_FUNCTION_ARGS); -extern Datum jsonb_object_agg_transfn(PG_FUNCTION_ARGS); -extern Datum jsonb_object_agg_finalfn(PG_FUNCTION_ARGS); - -/* Indexing-related ops */ -extern Datum jsonb_exists(PG_FUNCTION_ARGS); -extern Datum jsonb_exists_any(PG_FUNCTION_ARGS); -extern Datum jsonb_exists_all(PG_FUNCTION_ARGS); -extern Datum jsonb_contains(PG_FUNCTION_ARGS); -extern Datum jsonb_contained(PG_FUNCTION_ARGS); -extern Datum jsonb_ne(PG_FUNCTION_ARGS); -extern Datum jsonb_lt(PG_FUNCTION_ARGS); -extern Datum jsonb_gt(PG_FUNCTION_ARGS); -extern Datum jsonb_le(PG_FUNCTION_ARGS); -extern Datum jsonb_ge(PG_FUNCTION_ARGS); -extern Datum jsonb_eq(PG_FUNCTION_ARGS); -extern Datum jsonb_cmp(PG_FUNCTION_ARGS); -extern Datum jsonb_hash(PG_FUNCTION_ARGS); - -/* GIN support functions for jsonb_ops */ -extern Datum gin_compare_jsonb(PG_FUNCTION_ARGS); -extern Datum gin_extract_jsonb(PG_FUNCTION_ARGS); -extern Datum gin_extract_jsonb_query(PG_FUNCTION_ARGS); -extern Datum gin_consistent_jsonb(PG_FUNCTION_ARGS); -extern Datum gin_triconsistent_jsonb(PG_FUNCTION_ARGS); - -/* GIN support functions for jsonb_path_ops */ -extern Datum gin_extract_jsonb_path(PG_FUNCTION_ARGS); -extern Datum gin_extract_jsonb_query_path(PG_FUNCTION_ARGS); -extern Datum gin_consistent_jsonb_path(PG_FUNCTION_ARGS); -extern Datum gin_triconsistent_jsonb_path(PG_FUNCTION_ARGS); - -/* pretty printer, returns text */ -extern Datum jsonb_pretty(PG_FUNCTION_ARGS); - -/* concatenation */ -extern Datum jsonb_concat(PG_FUNCTION_ARGS); - -/* deletion */ -extern Datum jsonb_delete(PG_FUNCTION_ARGS); -extern Datum jsonb_delete_idx(PG_FUNCTION_ARGS); -extern Datum jsonb_delete_path(PG_FUNCTION_ARGS); - -/* replacement */ -extern Datum jsonb_set(PG_FUNCTION_ARGS); - -/* insert after or before (for arrays) */ -extern Datum jsonb_insert(PG_FUNCTION_ARGS); /* Support functions */ extern uint32 getJsonbOffset(const JsonbContainer *jc, int index); diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h index 07cdc2a8e3..4b0706a316 100644 --- a/src/include/utils/nabstime.h +++ b/src/include/utils/nabstime.h @@ -96,69 +96,6 @@ typedef TimeIntervalData *TimeInterval; ((bool) (((RelativeTime) (time)) != INVALID_RELTIME)) -/* - * nabstime.c prototypes - */ -extern Datum abstimein(PG_FUNCTION_ARGS); -extern Datum abstimeout(PG_FUNCTION_ARGS); -extern Datum abstimerecv(PG_FUNCTION_ARGS); -extern Datum abstimesend(PG_FUNCTION_ARGS); - -extern Datum abstimeeq(PG_FUNCTION_ARGS); -extern Datum abstimene(PG_FUNCTION_ARGS); -extern Datum abstimelt(PG_FUNCTION_ARGS); -extern Datum abstimegt(PG_FUNCTION_ARGS); -extern Datum abstimele(PG_FUNCTION_ARGS); -extern Datum abstimege(PG_FUNCTION_ARGS); -extern Datum abstime_finite(PG_FUNCTION_ARGS); - -extern Datum timestamp_abstime(PG_FUNCTION_ARGS); -extern Datum abstime_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_abstime(PG_FUNCTION_ARGS); -extern Datum abstime_timestamptz(PG_FUNCTION_ARGS); - -extern Datum reltimein(PG_FUNCTION_ARGS); -extern Datum reltimeout(PG_FUNCTION_ARGS); -extern Datum reltimerecv(PG_FUNCTION_ARGS); -extern Datum reltimesend(PG_FUNCTION_ARGS); -extern Datum tintervalin(PG_FUNCTION_ARGS); -extern Datum tintervalout(PG_FUNCTION_ARGS); -extern Datum tintervalrecv(PG_FUNCTION_ARGS); -extern Datum tintervalsend(PG_FUNCTION_ARGS); -extern Datum interval_reltime(PG_FUNCTION_ARGS); -extern Datum reltime_interval(PG_FUNCTION_ARGS); -extern Datum mktinterval(PG_FUNCTION_ARGS); -extern Datum timepl(PG_FUNCTION_ARGS); -extern Datum timemi(PG_FUNCTION_ARGS); - -extern Datum intinterval(PG_FUNCTION_ARGS); -extern Datum tintervalrel(PG_FUNCTION_ARGS); -extern Datum timenow(PG_FUNCTION_ARGS); -extern Datum reltimeeq(PG_FUNCTION_ARGS); -extern Datum reltimene(PG_FUNCTION_ARGS); -extern Datum reltimelt(PG_FUNCTION_ARGS); -extern Datum reltimegt(PG_FUNCTION_ARGS); -extern Datum reltimele(PG_FUNCTION_ARGS); -extern Datum reltimege(PG_FUNCTION_ARGS); -extern Datum tintervalsame(PG_FUNCTION_ARGS); -extern Datum tintervaleq(PG_FUNCTION_ARGS); -extern Datum tintervalne(PG_FUNCTION_ARGS); -extern Datum tintervallt(PG_FUNCTION_ARGS); -extern Datum tintervalgt(PG_FUNCTION_ARGS); -extern Datum tintervalle(PG_FUNCTION_ARGS); -extern Datum tintervalge(PG_FUNCTION_ARGS); -extern Datum tintervalleneq(PG_FUNCTION_ARGS); -extern Datum tintervallenne(PG_FUNCTION_ARGS); -extern Datum tintervallenlt(PG_FUNCTION_ARGS); -extern Datum tintervallengt(PG_FUNCTION_ARGS); -extern Datum tintervallenle(PG_FUNCTION_ARGS); -extern Datum tintervallenge(PG_FUNCTION_ARGS); -extern Datum tintervalct(PG_FUNCTION_ARGS); -extern Datum tintervalov(PG_FUNCTION_ARGS); -extern Datum tintervalstart(PG_FUNCTION_ARGS); -extern Datum tintervalend(PG_FUNCTION_ARGS); -extern Datum timeofday(PG_FUNCTION_ARGS); - /* non-fmgr-callable support routines */ extern AbsoluteTime GetCurrentAbsoluteTime(void); extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm * tm, char **tzn); diff --git a/src/include/utils/pg_lsn.h b/src/include/utils/pg_lsn.h index 40eed29964..6f038e9e14 100644 --- a/src/include/utils/pg_lsn.h +++ b/src/include/utils/pg_lsn.h @@ -18,22 +18,6 @@ #include "fmgr.h" #include "access/xlogdefs.h" -extern Datum pg_lsn_in(PG_FUNCTION_ARGS); -extern Datum pg_lsn_out(PG_FUNCTION_ARGS); -extern Datum pg_lsn_recv(PG_FUNCTION_ARGS); -extern Datum pg_lsn_send(PG_FUNCTION_ARGS); - -extern Datum pg_lsn_eq(PG_FUNCTION_ARGS); -extern Datum pg_lsn_ne(PG_FUNCTION_ARGS); -extern Datum pg_lsn_lt(PG_FUNCTION_ARGS); -extern Datum pg_lsn_gt(PG_FUNCTION_ARGS); -extern Datum pg_lsn_le(PG_FUNCTION_ARGS); -extern Datum pg_lsn_ge(PG_FUNCTION_ARGS); -extern Datum pg_lsn_cmp(PG_FUNCTION_ARGS); -extern Datum pg_lsn_hash(PG_FUNCTION_ARGS); - -extern Datum pg_lsn_mi(PG_FUNCTION_ARGS); - #define DatumGetLSN(X) ((XLogRecPtr) DatumGetInt64(X)) #define LSNGetDatum(X) (Int64GetDatum((int64) (X))) diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h index e06f2167db..abb2223ec5 100644 --- a/src/include/utils/rangetypes.h +++ b/src/include/utils/rangetypes.h @@ -92,45 +92,8 @@ typedef struct * prototypes for functions defined in rangetypes.c */ -/* I/O */ -extern Datum range_in(PG_FUNCTION_ARGS); -extern Datum range_out(PG_FUNCTION_ARGS); -extern Datum range_recv(PG_FUNCTION_ARGS); -extern Datum range_send(PG_FUNCTION_ARGS); - -/* constructors */ -extern Datum range_constructor2(PG_FUNCTION_ARGS); -extern Datum range_constructor3(PG_FUNCTION_ARGS); - -/* range -> subtype */ -extern Datum range_lower(PG_FUNCTION_ARGS); -extern Datum range_upper(PG_FUNCTION_ARGS); - -/* range -> bool */ -extern Datum range_empty(PG_FUNCTION_ARGS); -extern Datum range_lower_inc(PG_FUNCTION_ARGS); -extern Datum range_upper_inc(PG_FUNCTION_ARGS); -extern Datum range_lower_inf(PG_FUNCTION_ARGS); -extern Datum range_upper_inf(PG_FUNCTION_ARGS); - -/* range, element -> bool */ -extern Datum range_contains_elem(PG_FUNCTION_ARGS); -extern Datum elem_contained_by_range(PG_FUNCTION_ARGS); - extern bool range_contains_elem_internal(TypeCacheEntry *typcache, RangeType *r, Datum val); -/* range, range -> bool */ -extern Datum range_eq(PG_FUNCTION_ARGS); -extern Datum range_ne(PG_FUNCTION_ARGS); -extern Datum range_contains(PG_FUNCTION_ARGS); -extern Datum range_contained_by(PG_FUNCTION_ARGS); -extern Datum range_before(PG_FUNCTION_ARGS); -extern Datum range_after(PG_FUNCTION_ARGS); -extern Datum range_adjacent(PG_FUNCTION_ARGS); -extern Datum range_overlaps(PG_FUNCTION_ARGS); -extern Datum range_overleft(PG_FUNCTION_ARGS); -extern Datum range_overright(PG_FUNCTION_ARGS); - /* internal versions of the above */ extern bool range_eq_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); @@ -153,38 +116,6 @@ extern bool range_overleft_internal(TypeCacheEntry *typcache, RangeType *r1, extern bool range_overright_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); -/* range, range -> range */ -extern Datum range_minus(PG_FUNCTION_ARGS); -extern Datum range_union(PG_FUNCTION_ARGS); -extern Datum range_intersect(PG_FUNCTION_ARGS); - -/* BTree support */ -extern Datum range_cmp(PG_FUNCTION_ARGS); -extern Datum range_lt(PG_FUNCTION_ARGS); -extern Datum range_le(PG_FUNCTION_ARGS); -extern Datum range_ge(PG_FUNCTION_ARGS); -extern Datum range_gt(PG_FUNCTION_ARGS); - -/* Hash support */ -extern Datum hash_range(PG_FUNCTION_ARGS); - -/* ANALYZE support */ -extern Datum range_typanalyze(PG_FUNCTION_ARGS); -extern Datum rangesel(PG_FUNCTION_ARGS); - -/* Canonical functions */ -extern Datum int4range_canonical(PG_FUNCTION_ARGS); -extern Datum int8range_canonical(PG_FUNCTION_ARGS); -extern Datum daterange_canonical(PG_FUNCTION_ARGS); - -/* Subtype Difference functions */ -extern Datum int4range_subdiff(PG_FUNCTION_ARGS); -extern Datum int8range_subdiff(PG_FUNCTION_ARGS); -extern Datum numrange_subdiff(PG_FUNCTION_ARGS); -extern Datum daterange_subdiff(PG_FUNCTION_ARGS); -extern Datum tsrange_subdiff(PG_FUNCTION_ARGS); -extern Datum tstzrange_subdiff(PG_FUNCTION_ARGS); - /* assorted support functions */ extern TypeCacheEntry *range_get_typcache(FunctionCallInfo fcinfo, Oid rngtypid); @@ -205,15 +136,4 @@ extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1, RangeBound bound2); extern RangeType *make_empty_range(TypeCacheEntry *typcache); -/* GiST support (in rangetypes_gist.c) */ -extern Datum range_gist_consistent(PG_FUNCTION_ARGS); -extern Datum range_gist_compress(PG_FUNCTION_ARGS); -extern Datum range_gist_decompress(PG_FUNCTION_ARGS); -extern Datum range_gist_fetch(PG_FUNCTION_ARGS); -extern Datum range_gist_union(PG_FUNCTION_ARGS); -extern Datum range_merge(PG_FUNCTION_ARGS); -extern Datum range_gist_penalty(PG_FUNCTION_ARGS); -extern Datum range_gist_picksplit(PG_FUNCTION_ARGS); -extern Datum range_gist_same(PG_FUNCTION_ARGS); - #endif /* RANGETYPES_H */ diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h index b43dae7e75..9f9d2dcb2b 100644 --- a/src/include/utils/selfuncs.h +++ b/src/include/utils/selfuncs.h @@ -180,32 +180,6 @@ extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt, extern Const *make_greater_string(const Const *str_const, FmgrInfo *ltproc, Oid collation); -extern Datum eqsel(PG_FUNCTION_ARGS); -extern Datum neqsel(PG_FUNCTION_ARGS); -extern Datum scalarltsel(PG_FUNCTION_ARGS); -extern Datum scalargtsel(PG_FUNCTION_ARGS); -extern Datum regexeqsel(PG_FUNCTION_ARGS); -extern Datum icregexeqsel(PG_FUNCTION_ARGS); -extern Datum likesel(PG_FUNCTION_ARGS); -extern Datum iclikesel(PG_FUNCTION_ARGS); -extern Datum regexnesel(PG_FUNCTION_ARGS); -extern Datum icregexnesel(PG_FUNCTION_ARGS); -extern Datum nlikesel(PG_FUNCTION_ARGS); -extern Datum icnlikesel(PG_FUNCTION_ARGS); - -extern Datum eqjoinsel(PG_FUNCTION_ARGS); -extern Datum neqjoinsel(PG_FUNCTION_ARGS); -extern Datum scalarltjoinsel(PG_FUNCTION_ARGS); -extern Datum scalargtjoinsel(PG_FUNCTION_ARGS); -extern Datum regexeqjoinsel(PG_FUNCTION_ARGS); -extern Datum icregexeqjoinsel(PG_FUNCTION_ARGS); -extern Datum likejoinsel(PG_FUNCTION_ARGS); -extern Datum iclikejoinsel(PG_FUNCTION_ARGS); -extern Datum regexnejoinsel(PG_FUNCTION_ARGS); -extern Datum icregexnejoinsel(PG_FUNCTION_ARGS); -extern Datum nlikejoinsel(PG_FUNCTION_ARGS); -extern Datum icnlikejoinsel(PG_FUNCTION_ARGS); - extern Selectivity boolvarsel(PlannerInfo *root, Node *arg, int varRelid); extern Selectivity booltestsel(PlannerInfo *root, BoolTestType booltesttype, Node *arg, int varRelid, @@ -245,7 +219,5 @@ extern Selectivity scalararraysel_containment(PlannerInfo *root, Node *leftop, Node *rightop, Oid elemtype, bool isEquality, bool useOr, int varRelid); -extern Datum arraycontsel(PG_FUNCTION_ARGS); -extern Datum arraycontjoinsel(PG_FUNCTION_ARGS); #endif /* SELFUNCS_H */ diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index 1498c05369..2618cc4546 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -87,7 +87,6 @@ extern void AtSubCommit_Snapshot(int level); extern void AtSubAbort_Snapshot(int level); extern void AtEOXact_Snapshot(bool isCommit); -extern Datum pg_export_snapshot(PG_FUNCTION_ARGS); extern void ImportSnapshot(const char *idstr); extern bool XactHasExportedSnapshots(void); extern void DeleteAllExportedSnapshotFiles(void); diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 3ec8ecd3e7..21651b1c85 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -88,131 +88,6 @@ extern TimestampTz PgStartTime; extern TimestampTz PgReloadTime; -/* - * timestamp.c prototypes - */ - -extern Datum timestamp_in(PG_FUNCTION_ARGS); -extern Datum timestamp_out(PG_FUNCTION_ARGS); -extern Datum timestamp_recv(PG_FUNCTION_ARGS); -extern Datum timestamp_send(PG_FUNCTION_ARGS); -extern Datum timestamptypmodin(PG_FUNCTION_ARGS); -extern Datum timestamptypmodout(PG_FUNCTION_ARGS); -extern Datum timestamp_transform(PG_FUNCTION_ARGS); -extern Datum timestamp_scale(PG_FUNCTION_ARGS); -extern Datum timestamp_eq(PG_FUNCTION_ARGS); -extern Datum timestamp_ne(PG_FUNCTION_ARGS); -extern Datum timestamp_lt(PG_FUNCTION_ARGS); -extern Datum timestamp_le(PG_FUNCTION_ARGS); -extern Datum timestamp_ge(PG_FUNCTION_ARGS); -extern Datum timestamp_gt(PG_FUNCTION_ARGS); -extern Datum timestamp_finite(PG_FUNCTION_ARGS); -extern Datum timestamp_cmp(PG_FUNCTION_ARGS); -extern Datum timestamp_sortsupport(PG_FUNCTION_ARGS); -extern Datum timestamp_hash(PG_FUNCTION_ARGS); -extern Datum timestamp_smaller(PG_FUNCTION_ARGS); -extern Datum timestamp_larger(PG_FUNCTION_ARGS); - -extern Datum timestamp_eq_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_ne_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_lt_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_le_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_gt_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_ge_timestamptz(PG_FUNCTION_ARGS); -extern Datum timestamp_cmp_timestamptz(PG_FUNCTION_ARGS); - -extern Datum make_timestamp(PG_FUNCTION_ARGS); -extern Datum make_timestamptz(PG_FUNCTION_ARGS); -extern Datum make_timestamptz_at_timezone(PG_FUNCTION_ARGS); -extern Datum float8_timestamptz(PG_FUNCTION_ARGS); - -extern Datum timestamptz_eq_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_ne_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_lt_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_le_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_gt_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_ge_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_cmp_timestamp(PG_FUNCTION_ARGS); - -extern Datum interval_in(PG_FUNCTION_ARGS); -extern Datum interval_out(PG_FUNCTION_ARGS); -extern Datum interval_recv(PG_FUNCTION_ARGS); -extern Datum interval_send(PG_FUNCTION_ARGS); -extern Datum intervaltypmodin(PG_FUNCTION_ARGS); -extern Datum intervaltypmodout(PG_FUNCTION_ARGS); -extern Datum interval_transform(PG_FUNCTION_ARGS); -extern Datum interval_scale(PG_FUNCTION_ARGS); -extern Datum interval_eq(PG_FUNCTION_ARGS); -extern Datum interval_ne(PG_FUNCTION_ARGS); -extern Datum interval_lt(PG_FUNCTION_ARGS); -extern Datum interval_le(PG_FUNCTION_ARGS); -extern Datum interval_ge(PG_FUNCTION_ARGS); -extern Datum interval_gt(PG_FUNCTION_ARGS); -extern Datum interval_finite(PG_FUNCTION_ARGS); -extern Datum interval_cmp(PG_FUNCTION_ARGS); -extern Datum interval_hash(PG_FUNCTION_ARGS); -extern Datum interval_smaller(PG_FUNCTION_ARGS); -extern Datum interval_larger(PG_FUNCTION_ARGS); -extern Datum interval_justify_interval(PG_FUNCTION_ARGS); -extern Datum interval_justify_hours(PG_FUNCTION_ARGS); -extern Datum interval_justify_days(PG_FUNCTION_ARGS); -extern Datum make_interval(PG_FUNCTION_ARGS); - -extern Datum timestamp_trunc(PG_FUNCTION_ARGS); -extern Datum interval_trunc(PG_FUNCTION_ARGS); -extern Datum timestamp_part(PG_FUNCTION_ARGS); -extern Datum interval_part(PG_FUNCTION_ARGS); -extern Datum timestamp_zone_transform(PG_FUNCTION_ARGS); -extern Datum timestamp_zone(PG_FUNCTION_ARGS); -extern Datum timestamp_izone_transform(PG_FUNCTION_ARGS); -extern Datum timestamp_izone(PG_FUNCTION_ARGS); -extern Datum timestamp_timestamptz(PG_FUNCTION_ARGS); - -extern Datum timestamptz_in(PG_FUNCTION_ARGS); -extern Datum timestamptz_out(PG_FUNCTION_ARGS); -extern Datum timestamptz_recv(PG_FUNCTION_ARGS); -extern Datum timestamptz_send(PG_FUNCTION_ARGS); -extern Datum timestamptztypmodin(PG_FUNCTION_ARGS); -extern Datum timestamptztypmodout(PG_FUNCTION_ARGS); -extern Datum timestamptz_scale(PG_FUNCTION_ARGS); -extern Datum timestamptz_timestamp(PG_FUNCTION_ARGS); -extern Datum timestamptz_zone(PG_FUNCTION_ARGS); -extern Datum timestamptz_izone(PG_FUNCTION_ARGS); -extern Datum timestamptz_timestamptz(PG_FUNCTION_ARGS); - -extern Datum interval_um(PG_FUNCTION_ARGS); -extern Datum interval_pl(PG_FUNCTION_ARGS); -extern Datum interval_mi(PG_FUNCTION_ARGS); -extern Datum interval_mul(PG_FUNCTION_ARGS); -extern Datum mul_d_interval(PG_FUNCTION_ARGS); -extern Datum interval_div(PG_FUNCTION_ARGS); -extern Datum interval_accum(PG_FUNCTION_ARGS); -extern Datum interval_combine(PG_FUNCTION_ARGS); -extern Datum interval_accum_inv(PG_FUNCTION_ARGS); -extern Datum interval_avg(PG_FUNCTION_ARGS); - -extern Datum timestamp_mi(PG_FUNCTION_ARGS); -extern Datum timestamp_pl_interval(PG_FUNCTION_ARGS); -extern Datum timestamp_mi_interval(PG_FUNCTION_ARGS); -extern Datum timestamp_age(PG_FUNCTION_ARGS); -extern Datum overlaps_timestamp(PG_FUNCTION_ARGS); - -extern Datum timestamptz_pl_interval(PG_FUNCTION_ARGS); -extern Datum timestamptz_mi_interval(PG_FUNCTION_ARGS); -extern Datum timestamptz_age(PG_FUNCTION_ARGS); -extern Datum timestamptz_trunc(PG_FUNCTION_ARGS); -extern Datum timestamptz_part(PG_FUNCTION_ARGS); - -extern Datum now(PG_FUNCTION_ARGS); -extern Datum statement_timestamp(PG_FUNCTION_ARGS); -extern Datum clock_timestamp(PG_FUNCTION_ARGS); - -extern Datum pg_postmaster_start_time(PG_FUNCTION_ARGS); -extern Datum pg_conf_load_time(PG_FUNCTION_ARGS); - -extern Datum generate_series_timestamp(PG_FUNCTION_ARGS); -extern Datum generate_series_timestamptz(PG_FUNCTION_ARGS); - /* Internal routines (not fmgr-callable) */ extern int32 anytimestamp_typmod_check(bool istz, int32 typmod); diff --git a/src/include/utils/varbit.h b/src/include/utils/varbit.h index 5b910407d5..2a4ec67698 100644 --- a/src/include/utils/varbit.h +++ b/src/include/utils/varbit.h @@ -66,50 +66,4 @@ typedef struct /* Mask that will cover exactly one byte, i.e. BITS_PER_BYTE bits */ #define BITMASK 0xFF - -extern Datum bit_in(PG_FUNCTION_ARGS); -extern Datum bit_out(PG_FUNCTION_ARGS); -extern Datum bit_recv(PG_FUNCTION_ARGS); -extern Datum bit_send(PG_FUNCTION_ARGS); -extern Datum bittypmodin(PG_FUNCTION_ARGS); -extern Datum bittypmodout(PG_FUNCTION_ARGS); -extern Datum varbit_in(PG_FUNCTION_ARGS); -extern Datum varbit_out(PG_FUNCTION_ARGS); -extern Datum varbit_recv(PG_FUNCTION_ARGS); -extern Datum varbit_send(PG_FUNCTION_ARGS); -extern Datum varbittypmodin(PG_FUNCTION_ARGS); -extern Datum varbittypmodout(PG_FUNCTION_ARGS); -extern Datum bit(PG_FUNCTION_ARGS); -extern Datum varbit_transform(PG_FUNCTION_ARGS); -extern Datum varbit(PG_FUNCTION_ARGS); -extern Datum biteq(PG_FUNCTION_ARGS); -extern Datum bitne(PG_FUNCTION_ARGS); -extern Datum bitlt(PG_FUNCTION_ARGS); -extern Datum bitle(PG_FUNCTION_ARGS); -extern Datum bitgt(PG_FUNCTION_ARGS); -extern Datum bitge(PG_FUNCTION_ARGS); -extern Datum bitcmp(PG_FUNCTION_ARGS); - -/* avoid the names bitand and bitor, since they are C++ keywords */ -extern Datum bit_and(PG_FUNCTION_ARGS); -extern Datum bit_or(PG_FUNCTION_ARGS); -extern Datum bitxor(PG_FUNCTION_ARGS); -extern Datum bitnot(PG_FUNCTION_ARGS); -extern Datum bitshiftleft(PG_FUNCTION_ARGS); -extern Datum bitshiftright(PG_FUNCTION_ARGS); -extern Datum bitcat(PG_FUNCTION_ARGS); -extern Datum bitsubstr(PG_FUNCTION_ARGS); -extern Datum bitsubstr_no_len(PG_FUNCTION_ARGS); -extern Datum bitoverlay(PG_FUNCTION_ARGS); -extern Datum bitoverlay_no_len(PG_FUNCTION_ARGS); -extern Datum bitlength(PG_FUNCTION_ARGS); -extern Datum bitoctetlength(PG_FUNCTION_ARGS); -extern Datum bitfromint4(PG_FUNCTION_ARGS); -extern Datum bittoint4(PG_FUNCTION_ARGS); -extern Datum bitfromint8(PG_FUNCTION_ARGS); -extern Datum bittoint8(PG_FUNCTION_ARGS); -extern Datum bitposition(PG_FUNCTION_ARGS); -extern Datum bitsetbit(PG_FUNCTION_ARGS); -extern Datum bitgetbit(PG_FUNCTION_ARGS); - #endif diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h index 10f6bf5692..cc1fc390e8 100644 --- a/src/include/utils/xml.h +++ b/src/include/utils/xml.h @@ -52,39 +52,6 @@ typedef struct PgXmlErrorContext PgXmlErrorContext; #define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n)) #define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x) -extern Datum xml_in(PG_FUNCTION_ARGS); -extern Datum xml_out(PG_FUNCTION_ARGS); -extern Datum xml_recv(PG_FUNCTION_ARGS); -extern Datum xml_send(PG_FUNCTION_ARGS); -extern Datum xmlcomment(PG_FUNCTION_ARGS); -extern Datum xmlconcat2(PG_FUNCTION_ARGS); -extern Datum texttoxml(PG_FUNCTION_ARGS); -extern Datum xmltotext(PG_FUNCTION_ARGS); -extern Datum xmlvalidate(PG_FUNCTION_ARGS); -extern Datum xpath(PG_FUNCTION_ARGS); -extern Datum xpath_exists(PG_FUNCTION_ARGS); -extern Datum xmlexists(PG_FUNCTION_ARGS); -extern Datum xml_is_well_formed(PG_FUNCTION_ARGS); -extern Datum xml_is_well_formed_document(PG_FUNCTION_ARGS); -extern Datum xml_is_well_formed_content(PG_FUNCTION_ARGS); - -extern Datum table_to_xml(PG_FUNCTION_ARGS); -extern Datum query_to_xml(PG_FUNCTION_ARGS); -extern Datum cursor_to_xml(PG_FUNCTION_ARGS); -extern Datum table_to_xmlschema(PG_FUNCTION_ARGS); -extern Datum query_to_xmlschema(PG_FUNCTION_ARGS); -extern Datum cursor_to_xmlschema(PG_FUNCTION_ARGS); -extern Datum table_to_xml_and_xmlschema(PG_FUNCTION_ARGS); -extern Datum query_to_xml_and_xmlschema(PG_FUNCTION_ARGS); - -extern Datum schema_to_xml(PG_FUNCTION_ARGS); -extern Datum schema_to_xmlschema(PG_FUNCTION_ARGS); -extern Datum schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS); - -extern Datum database_to_xml(PG_FUNCTION_ARGS); -extern Datum database_to_xmlschema(PG_FUNCTION_ARGS); -extern Datum database_to_xml_and_xmlschema(PG_FUNCTION_ARGS); - extern void pg_xml_init_library(void); extern PgXmlErrorContext *pg_xml_init(PgXmlStrictness strictness); extern void pg_xml_done(PgXmlErrorContext *errcxt, bool isError); diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 8217d06f28..fbf4da3d68 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -268,7 +268,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY if (IsNewer( 'src/backend/utils/fmgrtab.c', 'src/include/catalog/pg_proc.h')) { - print "Generating fmgrtab.c and fmgroids.h...\n"; + print "Generating fmgrtab.c, fmgroids.h, fmgrprotos.h...\n"; chdir('src/backend/utils'); system( "perl -I ../catalog Gen_fmgrtab.pl ../../../src/include/catalog/pg_proc.h"); @@ -282,6 +282,14 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY 'src/include/utils/fmgroids.h'); } + if (IsNewer( + 'src/include/utils/fmgrprotos.h', + 'src/backend/utils/fmgrprotos.h')) + { + copyFile('src/backend/utils/fmgrprotos.h', + 'src/include/utils/fmgrprotos.h'); + } + if (IsNewer( 'src/include/storage/lwlocknames.h', 'src/backend/storage/lmgr/lwlocknames.txt')) diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat index e73df6e96f..ab51284e64 100755 --- a/src/tools/msvc/clean.bat +++ b/src/tools/msvc/clean.bat @@ -42,9 +42,11 @@ if exist src\include\dynloader.h del /q src\include\dynloader.h if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.h if exist src\include\utils\errcodes.h del /q src\include\utils\errcodes.h if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h +if exist src\include\utils\fmgrprotos.h del /q src\include\utils\fmgrprotos.h if exist src\include\utils\probes.h del /q src\include\utils\probes.h if %DIST%==1 if exist src\backend\utils\fmgroids.h del /q src\backend\utils\fmgroids.h +if %DIST%==1 if exist src\backend\utils\fmgrprotos.h del /q src\backend\utils\fmgrprotos.h if %DIST%==1 if exist src\backend\utils\fmgrtab.c del /q src\backend\utils\fmgrtab.c if %DIST%==1 if exist src\backend\catalog\postgres.bki del /q src\backend\catalog\postgres.bki if %DIST%==1 if exist src\backend\catalog\postgres.description del /q src\backend\catalog\postgres.description -- cgit v1.2.3