Skip to content

Commit 5bb2300

Browse files
committed
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.
1 parent 99198ac commit 5bb2300

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+570
-327
lines changed

contrib/fulltextindex/README.fti

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ sub-string will fit.
5757
The create the function that contains the trigger::
5858

5959
create function fti() returns opaque as
60-
'/path/to/fti.so' language 'newC';
60+
'/path/to/fti.so' language 'C';
6161

6262
And finally define the trigger on the 'cds' table:
6363

contrib/fulltextindex/fti.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Example:
1818
1919
create function fti() returns opaque as
20-
'/home/boekhold/src/postgresql-6.2/contrib/fti/fti.so' language 'newC';
20+
'/home/boekhold/src/postgresql-6.2/contrib/fti/fti.so' language 'C';
2121
2222
create table title_fti (string varchar(25), id oid);
2323
create index title_fti_idx on title_fti (string);
@@ -93,6 +93,8 @@ static int nDeletePlans = 0;
9393
static EPlan *find_plan(char *ident, EPlan ** eplan, int *nplans);
9494

9595
/***********************************************************************/
96+
PG_FUNCTION_INFO_V1(fti);
97+
9698
Datum
9799
fti(PG_FUNCTION_ARGS)
98100
{

contrib/fulltextindex/fti.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
# create function fti() returns opaque as
3131
# '/path/to/fti/file/fti.so'
32-
# language 'newC';
32+
# language 'C';
3333
#
3434
# create trigger my_fti_trigger after update or insert or delete
3535
# on mytable

contrib/fulltextindex/fti.sql.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
create function fti() returns opaque as
22
'MODULE_PATHNAME'
3-
language 'newC';
3+
language 'C';

contrib/lo/lo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* PostgreSQL type definitions for managed LargeObjects.
33
*
4-
* $Id: lo.c,v 1.4 2000/06/09 01:10:58 tgl Exp $
4+
* $Id: lo.c,v 1.5 2000/11/20 20:36:55 tgl Exp $
55
*
66
*/
77

@@ -140,6 +140,8 @@ lo(Oid oid)
140140
/*
141141
* This handles the trigger that protects us from orphaned large objects
142142
*/
143+
PG_FUNCTION_INFO_V1(lo_manage);
144+
143145
Datum
144146
lo_manage(PG_FUNCTION_ARGS)
145147
{

contrib/lo/lo.sql.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--
22
-- PostgreSQL code for LargeObjects
33
--
4-
-- $Id: lo.sql.in,v 1.4 2000/06/19 13:53:42 momjian Exp $
4+
-- $Id: lo.sql.in,v 1.5 2000/11/20 20:36:55 tgl Exp $
55
--
66
--
77
-- Create the data type
@@ -44,7 +44,7 @@ create function lo(oid)
4444
create function lo_manage()
4545
returns opaque
4646
as 'MODULE_PATHNAME'
47-
language 'newC';
47+
language 'C';
4848

4949
-- This allows us to map lo to oid
5050
--

contrib/noupdate/noup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ extern Datum noup(PG_FUNCTION_ARGS);
1616
* EXECUTE PROCEDURE noup ('col').
1717
*/
1818

19+
PG_FUNCTION_INFO_V1(noup);
20+
1921
Datum
2022
noup(PG_FUNCTION_ARGS)
2123
{

contrib/noupdate/noup.sql.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ DROP FUNCTION noup ();
33
CREATE FUNCTION noup ()
44
RETURNS opaque
55
AS 'MODULE_PATHNAME'
6-
LANGUAGE 'newC'
7-
;
6+
LANGUAGE 'C';

contrib/pgcrypto/pgcrypto.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: pgcrypto.c,v 1.1 2000/10/31 13:11:28 petere Exp $
29+
* $Id: pgcrypto.c,v 1.2 2000/11/20 20:36:56 tgl Exp $
3030
*/
3131

3232
#include <postgres.h>
@@ -59,6 +59,8 @@ find_digest(pg_digest *hbuf, text *name, int silent);
5959

6060

6161
/* SQL function: hash(text, text) returns text */
62+
PG_FUNCTION_INFO_V1(digest);
63+
6264
Datum
6365
digest(PG_FUNCTION_ARGS)
6466
{
@@ -95,6 +97,8 @@ digest(PG_FUNCTION_ARGS)
9597
}
9698

9799
/* check if given hash exists */
100+
PG_FUNCTION_INFO_V1(digest_exists);
101+
98102
Datum
99103
digest_exists(PG_FUNCTION_ARGS)
100104
{

contrib/pgcrypto/pgcrypto.sql.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
CREATE FUNCTION digest(text, text) RETURNS text
66
AS '@MODULE_FILENAME@',
7-
'digest' LANGUAGE 'newC';
7+
'digest' LANGUAGE 'C';
88

99
CREATE FUNCTION digest_exists(text) RETURNS bool
1010
AS '@MODULE_FILENAME@',
11-
'digest_exists' LANGUAGE 'newC';
11+
'digest_exists' LANGUAGE 'C';
1212

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy