1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Revise handling of oldstyle/newstyle functions per recent discussions

in pghackers list.  Support for oldstyle internal functions is gone
(no longer needed, since conversion is complete) and pg_language entry
'internal' now implies newstyle call convention.  pg_language entry
'newC' is gone; both old and newstyle dynamically loaded C functions
are now called language 'C'.  A newstyle function must be identified
by an associated info routine.  See src/backend/utils/fmgr/README.
This commit is contained in:
Tom Lane
2000-11-20 20:36:57 +00:00
parent 99198ac6b8
commit 5bb2300b59
52 changed files with 571 additions and 328 deletions

View File

@ -5,6 +5,8 @@
extern Datum autoinc(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(autoinc);
Datum
autoinc(PG_FUNCTION_ARGS)
{

View File

@ -3,4 +3,4 @@ DROP FUNCTION autoinc();
CREATE FUNCTION autoinc()
RETURNS opaque
AS 'MODULE_PATHNAME'
LANGUAGE 'newC';
LANGUAGE 'C';

View File

@ -12,6 +12,8 @@
extern Datum insert_username(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(insert_username);
Datum
insert_username(PG_FUNCTION_ARGS)
{

View File

@ -3,4 +3,4 @@ DROP FUNCTION insert_username();
CREATE FUNCTION insert_username()
RETURNS opaque
AS 'MODULE_PATHNAME'
LANGUAGE 'newC';
LANGUAGE 'C';

View File

@ -17,6 +17,8 @@ OH, me, I'm Terry Mackintosh <terry@terrym.com>
extern Datum moddatetime(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(moddatetime);
Datum
moddatetime(PG_FUNCTION_ARGS)
{

View File

@ -3,4 +3,4 @@ DROP FUNCTION moddatetime();
CREATE FUNCTION moddatetime()
RETURNS opaque
AS 'MODULE_PATHNAME'
LANGUAGE 'newC';
LANGUAGE 'C';

View File

@ -36,6 +36,8 @@ static EPlan *find_plan(char *ident, EPlan ** eplan, int *nplans);
* check_primary_key ('Fkey1', 'Fkey2', 'Ptable', 'Pkey1', 'Pkey2').
*/
PG_FUNCTION_INFO_V1(check_primary_key);
Datum
check_primary_key(PG_FUNCTION_ARGS)
{
@ -216,6 +218,8 @@ check_primary_key(PG_FUNCTION_ARGS)
* 'Ftable1', 'Fkey11', 'Fkey12', 'Ftable2', 'Fkey21', 'Fkey22').
*/
PG_FUNCTION_INFO_V1(check_foreign_key);
Datum
check_foreign_key(PG_FUNCTION_ARGS)
{

View File

@ -4,11 +4,9 @@ DROP FUNCTION check_foreign_key ();
CREATE FUNCTION check_primary_key ()
RETURNS opaque
AS 'MODULE_PATHNAME'
LANGUAGE 'newC'
;
LANGUAGE 'C';
CREATE FUNCTION check_foreign_key ()
RETURNS opaque
AS 'MODULE_PATHNAME'
LANGUAGE 'newC'
;
LANGUAGE 'C';

View File

@ -47,6 +47,8 @@ static EPlan *find_plan(char *ident, EPlan ** eplan, int *nplans);
* timetravel ('date_on', 'date_off').
*/
PG_FUNCTION_INFO_V1(timetravel);
Datum
timetravel(PG_FUNCTION_ARGS)
{
@ -326,6 +328,8 @@ timetravel(PG_FUNCTION_ARGS)
* set_timetravel (relname, on) --
* turn timetravel for specified relation ON/OFF
*/
PG_FUNCTION_INFO_V1(set_timetravel);
Datum
set_timetravel(PG_FUNCTION_ARGS)
{

View File

@ -4,9 +4,9 @@ DROP FUNCTION set_timetravel(name, int4);
CREATE FUNCTION timetravel()
RETURNS opaque
AS 'MODULE_PATHNAME'
LANGUAGE 'newC';
LANGUAGE 'C';
CREATE FUNCTION set_timetravel(name, int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'newC' WITH (isStrict);
LANGUAGE 'C' WITH (isStrict);