Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
archive-module-init.html28 linesDownload Raw Back to html
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>51.1. Initialization Functions</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="archive-modules.html" title="Chapter 51. Archive Modules" /><link rel="next" href="archive-module-callbacks.html" title="51.2. Archive Module Callbacks" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">51.1. Initialization Functions</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="archive-modules.html" title="Chapter 51. Archive Modules">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="archive-modules.html" title="Chapter 51. Archive Modules">Up</a></td><th width="60%" align="center">Chapter 51. Archive Modules</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="archive-module-callbacks.html" title="51.2. Archive Module Callbacks">Next</a></td></tr></table><hr /></div><div class="sect1" id="ARCHIVE-MODULE-INIT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">51.1. Initialization Functions <a href="#ARCHIVE-MODULE-INIT" class="id_link">#</a></h2></div></div></div><a id="id-1.8.16.7.2" class="indexterm"></a><p>3   An archive library is loaded by dynamically loading a shared library with the4   <a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-LIBRARY">archive_library</a>'s name as the library base name.  The5   normal library search path is used to locate the library.  To provide the6   required archive module callbacks and to indicate that the library is7   actually an archive module, it needs to provide a function named8   <code class="function">_PG_archive_module_init</code>.  The result of the function9   must be a pointer to a struct of type10   <code class="structname">ArchiveModuleCallbacks</code>, which contains everything11   that the core code needs to know to make use of the archive module.  The12   return value needs to be of server lifetime, which is typically achieved by13   defining it as a <code class="literal">static const</code> variable in global scope.14 15</p><pre class="programlisting">16typedef struct ArchiveModuleCallbacks17{18    ArchiveStartupCB startup_cb;19    ArchiveCheckConfiguredCB check_configured_cb;20    ArchiveFileCB archive_file_cb;21    ArchiveShutdownCB shutdown_cb;22} ArchiveModuleCallbacks;23typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void);24</pre><p>25 26   Only the <code class="function">archive_file_cb</code> callback is required.  The27   others are optional.28  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="archive-modules.html" title="Chapter 51. Archive Modules">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="archive-modules.html" title="Chapter 51. Archive Modules">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="archive-module-callbacks.html" title="51.2. Archive Module Callbacks">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 51. Archive Modules </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 51.2. Archive Module Callbacks</td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai