aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-05-31 20:58:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-05-31 20:58:09 +0000
commit8f165ee13b11baf17b91d858c535419c33a755d6 (patch)
tree24edff7fbb527e614b27305af7f5f44539f696f8 /doc/src
parentc269f0f1e2c760dde7a2c95ab09f913fa2aef1c4 (diff)
downloadpostgresql-8f165ee13b11baf17b91d858c535419c33a755d6.tar.gz
postgresql-8f165ee13b11baf17b91d858c535419c33a755d6.zip
Make PG_MODULE_MAGIC required in shared libraries that are loaded into
the server. Per discussion, there seems no point in a waiting period before making this required.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/xfunc.sgml72
1 files changed, 36 insertions, 36 deletions
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index b803ea2c9ee..6321bf5b0a7 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.114 2006/05/30 21:21:29 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.115 2006/05/31 20:58:09 tgl Exp $ -->
<sect1 id="xfunc">
<title>User-Defined Functions</title>
@@ -1912,6 +1912,41 @@ concat_text(PG_FUNCTION_ARGS)
<listitem>
<para>
+ To ensure your module is not loaded into an incompatible server,
+ it must include a <quote>magic block</>. This allows
+ the server to detect obvious incompatibilities, such as a module
+ compiled for a different major version of
+ <productname>PostgreSQL</productname>. A magic block is required
+ as of <productname>PostgreSQL</productname> 8.2. To include a magic
+ block, write this in one (and only one) of your module source files,
+ after having included the header <filename>fmgr.h</>:
+ </para>
+
+<programlisting>
+#ifdef PG_MODULE_MAGIC
+PG_MODULE_MAGIC;
+#endif
+</programlisting>
+
+ <para>
+ The <literal>#ifdef</> test can be omitted if your code doesn't
+ need to compile against pre-8.2 <productname>PostgreSQL</productname>
+ releases.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Compiling and linking your code so that it can be dynamically
+ loaded into <productname>PostgreSQL</productname> always
+ requires special flags. See <xref linkend="dfunc"> for a
+ detailed explanation of how to do it for your particular
+ operating system.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
When allocating memory, use the
<productname>PostgreSQL</productname> functions
<function>palloc</function><indexterm><primary>palloc</></> and <function>pfree</function><indexterm><primary>pfree</></>
@@ -1960,41 +1995,6 @@ concat_text(PG_FUNCTION_ARGS)
error messages to this effect.
</para>
</listitem>
-
- <listitem>
- <para>
- To ensure your module is not loaded into an incompatible server, it
- is recommended to include a <quote>magic block</>. This allows
- the server to detect obvious incompatibilities, such as a module
- compiled for a different major version of
- <productname>PostgreSQL</productname>. It is likely that magic
- blocks will be required in future releases. To include a magic
- block, write this in one (and only one) of your module source files,
- after having included the header <filename>fmgr.h</>:
- </para>
-
-<programlisting>
-#ifdef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-</programlisting>
-
- <para>
- The <literal>#ifdef</> test can be omitted if your code doesn't
- need to compile against pre-8.2 <productname>PostgreSQL</productname>
- releases.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Compiling and linking your code so that it can be dynamically
- loaded into <productname>PostgreSQL</productname> always
- requires special flags. See <xref linkend="dfunc"> for a
- detailed explanation of how to do it for your particular
- operating system.
- </para>
- </listitem>
</itemizedlist>
</para>
</sect2>