Home Explore Blog CI



postgresql

41th chunk of `doc/src/sgml/installation.sgml`
1c2fc8fc2f40a1e67e39bd1c3d20e8fba9303bb7c0a02d650000000100000fa1
 option provides, you
        can refer to the <option>--debug</option> and
        <option>--optimization</option> flags.
       </para>

       <para>
        The following build types are generally used: <option>plain</option>,
        <option>debug</option>, <option>debugoptimized</option> and
        <option>release</option>.  More information about them can be found in
        the <ulink
        url="https://mesonbuild.com/Running-Meson.html#configuring-the-build-directory">Meson
        documentation</ulink>.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="configure-debug-meson">
      <term><option>--debug</option></term>
      <listitem>
       <para>
        Compiles all programs and libraries with debugging symbols.  This
        means that you can run the programs in a debugger to analyze
        problems. This enlarges the size of the installed executables
        considerably, and on non-GCC compilers it usually also disables
        compiler optimization, causing slowdowns. However, having the symbols
        available is extremely helpful for dealing with any problems that
        might arise.  Currently, this option is recommended for production
        installations only if you use GCC.  But you should always have it on
        if you are doing development work or running a beta version.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="configure-optimization-meson">
      <term><option>--optimization</option>=<replaceable>LEVEL</replaceable></term>
      <listitem>
       <para>
        Specify the optimization level. <option>LEVEL</option> can be set to any of {0,g,1,2,3,s}.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="configure-werror-meson">
      <term><option>--werror</option></term>
      <listitem>
       <para>
        Setting this option asks the compiler to treat warnings as
        errors. This can be useful for code development.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="configure-cassert-meson">
      <term><option>-Dcassert={ true | false }</option></term>
      <listitem>
       <para>
        Enables <firstterm>assertion</firstterm> checks in the server, which
        test for many <quote>cannot happen</quote> conditions.  This is
        invaluable for code development purposes, but the tests slow down the
        server significantly.  Also, having the tests turned on won't
        necessarily enhance the stability of your server!  The assertion
        checks are not categorized for severity, and so what might be a
        relatively harmless bug will still lead to server restarts if it
        triggers an assertion failure.  This option is not recommended for
        production use, but you should have it on for development work or when
        running a beta version.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="configure-tap-tests-meson">
      <term><option>-Dtap_tests={ auto | enabled | disabled }</option></term>
      <listitem>
       <para>
        Enable tests using the Perl TAP tools.  Defaults to auto and requires
        a Perl installation and the Perl module <literal>IPC::Run</literal>.
        See <xref linkend="regress-tap"/> for more information.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="configure-pg-test-extra-meson">
      <term><option>-DPG_TEST_EXTRA=<replaceable>TEST_SUITES</replaceable></option></term>
      <listitem>
       <para>
        Enable additional test suites, which are not run by default because
        they are not secure to run on a multiuser system, require special
        software to run, or are resource intensive.  The argument is a
        whitespace-separated list of tests to enable. See
        <xref linkend="regress-additional"/> for details. If the
        <envar>PG_TEST_EXTRA</envar> environment variable is set when the
        tests are run, it overrides

Title: Meson Build Options for PostgreSQL Development
Summary
This section describes various Meson build options for PostgreSQL, including debug symbols, optimization levels, warning treatment, assertion checks, and test suites, which are useful for development, debugging, and testing purposes, but may not be suitable for production environments.