|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.114 2006/05/30 21:21:29 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.115 2006/05/31 20:58:09 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <sect1 id="xfunc">
|
4 | 4 | <title>User-Defined Functions</title>
|
@@ -1910,6 +1910,41 @@ concat_text(PG_FUNCTION_ARGS)
|
1910 | 1910 | </para>
|
1911 | 1911 | </listitem>
|
1912 | 1912 |
|
| 1913 | + <listitem> |
| 1914 | + <para> |
| 1915 | + To ensure your module is not loaded into an incompatible server, |
| 1916 | + it must include a <quote>magic block</>. This allows |
| 1917 | + the server to detect obvious incompatibilities, such as a module |
| 1918 | + compiled for a different major version of |
| 1919 | + <productname>PostgreSQL</productname>. A magic block is required |
| 1920 | + as of <productname>PostgreSQL</productname> 8.2. To include a magic |
| 1921 | + block, write this in one (and only one) of your module source files, |
| 1922 | + after having included the header <filename>fmgr.h</>: |
| 1923 | + </para> |
| 1924 | + |
| 1925 | +<programlisting> |
| 1926 | +#ifdef PG_MODULE_MAGIC |
| 1927 | +PG_MODULE_MAGIC; |
| 1928 | +#endif |
| 1929 | +</programlisting> |
| 1930 | + |
| 1931 | + <para> |
| 1932 | + The <literal>#ifdef</> test can be omitted if your code doesn't |
| 1933 | + need to compile against pre-8.2 <productname>PostgreSQL</productname> |
| 1934 | + releases. |
| 1935 | + </para> |
| 1936 | + </listitem> |
| 1937 | + |
| 1938 | + <listitem> |
| 1939 | + <para> |
| 1940 | + Compiling and linking your code so that it can be dynamically |
| 1941 | + loaded into <productname>PostgreSQL</productname> always |
| 1942 | + requires special flags. See <xref linkend="dfunc"> for a |
| 1943 | + detailed explanation of how to do it for your particular |
| 1944 | + operating system. |
| 1945 | + </para> |
| 1946 | + </listitem> |
| 1947 | + |
1913 | 1948 | <listitem>
|
1914 | 1949 | <para>
|
1915 | 1950 | When allocating memory, use the
|
@@ -1960,41 +1995,6 @@ concat_text(PG_FUNCTION_ARGS)
|
1960 | 1995 | error messages to this effect.
|
1961 | 1996 | </para>
|
1962 | 1997 | </listitem>
|
1963 |
| - |
1964 |
| - <listitem> |
1965 |
| - <para> |
1966 |
| - To ensure your module is not loaded into an incompatible server, it |
1967 |
| - is recommended to include a <quote>magic block</>. This allows |
1968 |
| - the server to detect obvious incompatibilities, such as a module |
1969 |
| - compiled for a different major version of |
1970 |
| - <productname>PostgreSQL</productname>. It is likely that magic |
1971 |
| - blocks will be required in future releases. To include a magic |
1972 |
| - block, write this in one (and only one) of your module source files, |
1973 |
| - after having included the header <filename>fmgr.h</>: |
1974 |
| - </para> |
1975 |
| - |
1976 |
| -<programlisting> |
1977 |
| -#ifdef PG_MODULE_MAGIC |
1978 |
| -PG_MODULE_MAGIC; |
1979 |
| -#endif |
1980 |
| -</programlisting> |
1981 |
| - |
1982 |
| - <para> |
1983 |
| - The <literal>#ifdef</> test can be omitted if your code doesn't |
1984 |
| - need to compile against pre-8.2 <productname>PostgreSQL</productname> |
1985 |
| - releases. |
1986 |
| - </para> |
1987 |
| - </listitem> |
1988 |
| - |
1989 |
| - <listitem> |
1990 |
| - <para> |
1991 |
| - Compiling and linking your code so that it can be dynamically |
1992 |
| - loaded into <productname>PostgreSQL</productname> always |
1993 |
| - requires special flags. See <xref linkend="dfunc"> for a |
1994 |
| - detailed explanation of how to do it for your particular |
1995 |
| - operating system. |
1996 |
| - </para> |
1997 |
| - </listitem> |
1998 | 1998 | </itemizedlist>
|
1999 | 1999 | </para>
|
2000 | 2000 | </sect2>
|
|
0 commit comments