Home Explore Blog CI



postgresql

28th chunk of `doc/src/sgml/installation.sgml`
896d1be6808208c99c5203faabaf9ae84abbafb3e67dd4280000000100000fa5
 url="https://mesonbuild.com/Running-Meson.html#building-from-the-source">
    Meson documentation</ulink>.
   </para>
  </step>

  <step>
   <title>Regression Tests</title>

   <indexterm>
    <primary>regression test</primary>
   </indexterm>

   <para>
    If you want to test the newly built server before you install it,
    you can run the regression tests at this point. The regression
    tests are a test suite to verify that <productname>PostgreSQL</productname>
    runs on your machine in the way the developers expected it
    to. Type:
<screen>
<userinput>meson test</userinput>
</screen>
    (This won't work as root; do it as an unprivileged user.)
    See <xref linkend="regress"/> for
    detailed information about interpreting the test results. You can
    repeat this test at any later time by issuing the same command.
   </para>

   <para>
    To run pg_regress and pg_isolation_regress tests against a running
    postgres instance, specify <userinput>--setup running</userinput> as an
    argument to <userinput>meson test</userinput>.
   </para>
  </step>

  <step id="meson-install">
   <title>Installing the Files</title>

   <note>
    <para>
     If you are upgrading an existing system be sure to read
     <xref linkend="upgrading"/>,
     which has instructions about upgrading a
     cluster.
    </para>
   </note>

   <para>
    Once PostgreSQL is built, you can install it by simply running the
    <literal>ninja install</literal> command.
<screen>
ninja install
</screen>
   </para>

   <para>
    This will install files into the directories that were specified
    in <xref linkend="meson-configure"/>. Make sure that you have appropriate
    permissions to write into that area. You might need to do this
    step as root. Alternatively, you can create the target directories
    in advance and arrange for appropriate permissions to be granted.
    The standard installation provides all the header files needed for client
    application development as well as for server-side program
    development, such as custom functions or data types written in C.
   </para>

   <para>
    <literal>ninja install</literal> should work for most cases, but if you'd
    like to use more options (such as <option>--quiet</option> to suppress
    extra output), you could also use <literal>meson install</literal>
    instead. You can learn more about <ulink
    url="https://mesonbuild.com/Commands.html#install">meson install</ulink>
    and its options in the Meson documentation.
   </para>
  </step>
  </procedure>

  <formalpara>
   <title>Uninstallation:</title>
   <para>
    To undo the installation, you can use the <command>ninja
    uninstall</command> command.
   </para>
  </formalpara>

  <formalpara>
   <title>Cleaning:</title>
   <para>
    After the installation, you can free disk space by removing the built
    files from the source tree with the <command>ninja clean</command>
    command.
   </para>
  </formalpara>
  </sect2>

  <sect2 id="meson-options">
   <title><literal>meson setup</literal> Options</title>

   <para>
    <command>meson setup</command>'s command-line options are explained below.
    This list is not exhaustive (use <literal>meson configure --help</literal>
    to get one that is).  The options not covered here are meant for advanced
    use-cases, and are documented in the standard <ulink
    url="https://mesonbuild.com/Commands.html#configure">Meson
    documentation</ulink>.  These arguments can be used with <command>meson
    setup</command> as well.
   </para>

   <sect3 id="meson-options-locations">
    <title>Installation Locations</title>

     <para>
      These options control where <literal>ninja install</literal> (or <literal>meson install</literal>) will put
      the files.  The <option>--prefix</option> option (example
      <xref linkend="install-short-meson"/>) is sufficient for
      most cases.  If you have special needs, you can customize the
      installation subdirectories with the other

Title: Installing and Managing PostgreSQL with Meson
Summary
This section covers the steps to install PostgreSQL after building it with Meson, including running the ninja install command, managing installation locations, and providing options for customization, as well as uninstallation and cleaning up built files, with references to Meson documentation for advanced use cases.