diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 22 | ||||
-rw-r--r-- | doc/src/sgml/xfunc.sgml | 27 |
2 files changed, 49 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 907c9ef7efa..5bf6656deca 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -25043,6 +25043,28 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n); <row> <entry role="func_table_entry"><para role="func_signature"> <indexterm> + <primary>pg_get_loaded_modules</primary> + </indexterm> + <function>pg_get_loaded_modules</function> () + <returnvalue>setof record</returnvalue> + ( <parameter>module_name</parameter> <type>text</type>, + <parameter>version</parameter> <type>text</type>, + <parameter>file_name</parameter> <type>text</type> ) + </para> + <para> + Returns a list of the loadable modules that are loaded into the + current server session. The <parameter>module_name</parameter> + and <parameter>version</parameter> fields are NULL unless the + module author supplied values for them using + the <literal>PG_MODULE_MAGIC_EXT</literal> macro. + The <parameter>file_name</parameter> field gives the file + name of the module (shared library). + </para></entry> + </row> + + <row> + <entry role="func_table_entry"><para role="func_signature"> + <indexterm> <primary>pg_my_temp_schema</primary> </indexterm> <function>pg_my_temp_schema</function> () diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 9f22dacac7d..35d34f224ef 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -1954,6 +1954,9 @@ CREATE FUNCTION square_root(double precision) RETURNS double precision <indexterm zone="xfunc-c-dynload"> <primary>magic block</primary> </indexterm> + <indexterm zone="xfunc-c-dynload"> + <primary><literal>PG_MODULE_MAGIC</literal></primary> + </indexterm> <para> To ensure that a dynamically loaded object file is not loaded into an @@ -1968,6 +1971,30 @@ CREATE FUNCTION square_root(double precision) RETURNS double precision <programlisting> PG_MODULE_MAGIC; </programlisting> +or +<programlisting> +PG_MODULE_MAGIC_EXT(<replaceable>parameters</replaceable>); +</programlisting> + </para> + + <para> + The <literal>PG_MODULE_MAGIC_EXT</literal> variant allows the specification + of additional information about the module; currently, a name and/or a + version string can be added. (More fields might be allowed in future.) + Write something like this: + +<programlisting> +PG_MODULE_MAGIC_EXT( + .name = "my_module_name", + .version = "1.2.3" +); +</programlisting> + + Subsequently the name and version can be examined via + the <function>pg_get_loaded_modules()</function> function. + The meaning of the version string is not restricted + by <productname>PostgreSQL</productname>, but use of semantic versioning + rules is recommended. </para> <para> |