magic block in doc functions

Поиск
Список
Период
Сортировка
От Euler Taveira de Oliveira
Тема magic block in doc functions
Дата
Msg-id 4B036C8F.6070703@timbira.com
обсуждение исходный текст
Ответы Re: magic block in doc functions
Список pgsql-hackers
Hi,

I noticed that some example functions don't contain the magic block and that
leads to error while loading those examples in 8.2 or later.

Attached is a patch that adds it. I also add some missing header file. Don't
have a strong opinion about backpatching it or not.


--
  Euler Taveira de Oliveira
  http://www.timbira.com/
Index: doc/src/sgml/plhandler.sgml
===================================================================
RCS file: /a/pgsql/dev/anoncvs/pgsql/doc/src/sgml/plhandler.sgml,v
retrieving revision 1.8
diff -c -r1.8 plhandler.sgml
*** doc/src/sgml/plhandler.sgml    8 Oct 2009 04:41:07 -0000    1.8
--- doc/src/sgml/plhandler.sgml    17 Nov 2009 02:44:26 -0000
***************
*** 106,111 ****
--- 106,115 ----
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"

+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif
+
  PG_FUNCTION_INFO_V1(plsample_call_handler);

  Datum
Index: doc/src/sgml/trigger.sgml
===================================================================
RCS file: /a/pgsql/dev/anoncvs/pgsql/doc/src/sgml/trigger.sgml,v
retrieving revision 1.59
diff -c -r1.59 trigger.sgml
*** doc/src/sgml/trigger.sgml    14 Oct 2009 22:14:21 -0000    1.59
--- doc/src/sgml/trigger.sgml    17 Nov 2009 02:50:27 -0000
***************
*** 576,581 ****
--- 576,585 ----
  #include "executor/spi.h"       /* this is what you need to work with SPI */
  #include "commands/trigger.h"   /* ... and triggers */

+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif
+
  extern Datum trigf(PG_FUNCTION_ARGS);

  PG_FUNCTION_INFO_V1(trigf);
Index: doc/src/sgml/xfunc.sgml
===================================================================
RCS file: /a/pgsql/dev/anoncvs/pgsql/doc/src/sgml/xfunc.sgml,v
retrieving revision 1.140
diff -c -r1.140 xfunc.sgml
*** doc/src/sgml/xfunc.sgml    8 Oct 2009 02:39:16 -0000    1.140
--- doc/src/sgml/xfunc.sgml    18 Nov 2009 03:13:07 -0000
***************
*** 1925,1930 ****
--- 1925,1935 ----
  <programlisting><![CDATA[
  #include "postgres.h"
  #include <string.h>
+ #include "utils/geo_decls.h"
+
+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif

  /* by value */

***************
*** 2099,2104 ****
--- 2104,2114 ----
  #include "postgres.h"
  #include <string.h>
  #include "fmgr.h"
+ #include "utils/geo_decls.h"
+
+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif

  /* by value */

***************
*** 2638,2643 ****
--- 2648,2657 ----
  #include "postgres.h"
  #include "executor/executor.h"  /* for GetAttributeByName() */

+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif
+
  bool
  c_overpaid(HeapTupleHeader t, /* the current row of emp */
             int32 limit)
***************
*** 2659,2664 ****
--- 2673,2682 ----
  #include "postgres.h"
  #include "executor/executor.h"  /* for GetAttributeByName() */

+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif
+
  PG_FUNCTION_INFO_V1(c_overpaid);

  Datum

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joshua Tolley
Дата:
Сообщение: Re: plperl and inline functions -- first draft
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: plperl and inline functions -- first draft