Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6e3117c

Browse files
committed
Add PG_MODULE_MAGIC and some missing include files to examples
Author: Euler Taveira de Oliveira <euler@timbira.com>
1 parent 8d97c1d commit 6e3117c

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

doc/src/sgml/plhandler.sgml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/plhandler.sgml,v 1.8 2009/10/08 04:41:07 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/plhandler.sgml,v 1.9 2009/11/23 21:41:20 petere Exp $ -->
22

33
<chapter id="plhandler">
44
<title>Writing A Procedural Language Handler</title>
@@ -106,6 +106,10 @@
106106
#include "catalog/pg_proc.h"
107107
#include "catalog/pg_type.h"
108108

109+
#ifdef PG_MODULE_MAGIC
110+
PG_MODULE_MAGIC;
111+
#endif
112+
109113
PG_FUNCTION_INFO_V1(plsample_call_handler);
110114

111115
Datum

doc/src/sgml/trigger.sgml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/trigger.sgml,v 1.60 2009/11/20 20:38:09 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/trigger.sgml,v 1.61 2009/11/23 21:41:20 petere Exp $ -->
22

33
<chapter id="triggers">
44
<title>Triggers</title>
@@ -596,6 +596,10 @@ CREATE TABLE ttest (
596596
#include "executor/spi.h" /* this is what you need to work with SPI */
597597
#include "commands/trigger.h" /* ... and triggers */
598598

599+
#ifdef PG_MODULE_MAGIC
600+
PG_MODULE_MAGIC;
601+
#endif
602+
599603
extern Datum trigf(PG_FUNCTION_ARGS);
600604

601605
PG_FUNCTION_INFO_V1(trigf);

doc/src/sgml/xfunc.sgml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.140 2009/10/08 02:39:16 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.141 2009/11/23 21:41:20 petere Exp $ -->
22

33
<sect1 id="xfunc">
44
<title>User-Defined Functions</title>
@@ -1925,6 +1925,11 @@ memcpy(destination->data, buffer, 40);
19251925
<programlisting><![CDATA[
19261926
#include "postgres.h"
19271927
#include <string.h>
1928+
#include "utils/geo_decls.h"
1929+
1930+
#ifdef PG_MODULE_MAGIC
1931+
PG_MODULE_MAGIC;
1932+
#endif
19281933

19291934
/* by value */
19301935

@@ -2099,6 +2104,11 @@ PG_FUNCTION_INFO_V1(funcname);
20992104
#include "postgres.h"
21002105
#include <string.h>
21012106
#include "fmgr.h"
2107+
#include "utils/geo_decls.h"
2108+
2109+
#ifdef PG_MODULE_MAGIC
2110+
PG_MODULE_MAGIC;
2111+
#endif
21022112

21032113
/* by value */
21042114

@@ -2638,6 +2648,10 @@ SELECT name, c_overpaid(emp, 1500) AS overpaid
26382648
#include "postgres.h"
26392649
#include "executor/executor.h" /* for GetAttributeByName() */
26402650

2651+
#ifdef PG_MODULE_MAGIC
2652+
PG_MODULE_MAGIC;
2653+
#endif
2654+
26412655
bool
26422656
c_overpaid(HeapTupleHeader t, /* the current row of emp */
26432657
int32 limit)
@@ -2659,6 +2673,10 @@ c_overpaid(HeapTupleHeader t, /* the current row of emp */
26592673
#include "postgres.h"
26602674
#include "executor/executor.h" /* for GetAttributeByName() */
26612675

2676+
#ifdef PG_MODULE_MAGIC
2677+
PG_MODULE_MAGIC;
2678+
#endif
2679+
26622680
PG_FUNCTION_INFO_V1(c_overpaid);
26632681

26642682
Datum

0 commit comments

Comments
 (0)