Home Explore Blog CI



postgresql

15th chunk of `doc/src/sgml/pltcl.sgml`
c2713dcf55877dd823c1dee5e90d9524f0427e979d6a11ad0000000100000843
 Transactions cannot be ended when an explicit subtransaction is active.
    </para>
   </sect1>

   <sect1 id="pltcl-config">
    <title>PL/Tcl Configuration</title>

    <para>
     This section lists configuration parameters that
     affect <application>PL/Tcl</application>.
    </para>

    <variablelist>

     <varlistentry id="guc-pltcl-start-proc" xreflabel="pltcl.start_proc">
      <term>
       <varname>pltcl.start_proc</varname> (<type>string</type>)
       <indexterm>
        <primary><varname>pltcl.start_proc</varname> configuration parameter</primary>
       </indexterm>
      </term>
      <listitem>
       <para>
        This parameter, if set to a nonempty string, specifies the name
        (possibly schema-qualified) of a parameterless PL/Tcl function that
        is to be executed whenever a new Tcl interpreter is created for
        PL/Tcl.  Such a function can perform per-session initialization, such
        as loading additional Tcl code.  A new Tcl interpreter is created
        when a PL/Tcl function is first executed in a database session, or
        when an additional interpreter has to be created because a PL/Tcl
        function is called by a new SQL role.
       </para>

       <para>
        The referenced function must be written in the <literal>pltcl</literal>
        language, and must not be marked <literal>SECURITY DEFINER</literal>.
        (These restrictions ensure that it runs in the interpreter it's
        supposed to initialize.)  The current user must have permission to
        call it, too.
       </para>

       <para>
        If the function fails with an error it will abort the function call
        that caused the new interpreter to be created and propagate out to
        the calling query, causing the current transaction or subtransaction
        to be aborted.  Any actions already done within Tcl won't be undone;
        however, that interpreter won't be used again.  If the language is
        used again the initialization will be attempted again within a fresh
        Tcl interpreter.
       </para>

       <para>
        Only

Title: PL/Tcl Configuration: pltcl.start_proc
Summary
This section describes the `pltcl.start_proc` configuration parameter in PL/Tcl. This parameter, when set to a non-empty string, specifies a parameterless PL/Tcl function that is executed whenever a new Tcl interpreter is created for PL/Tcl. This function is used for per-session initialization, such as loading additional Tcl code. The interpreter is created when a PL/Tcl function is first executed in a session or when a new SQL role calls a PL/Tcl function. The function must be written in `pltcl`, not be `SECURITY DEFINER`, and the current user must have permission to call it. If the function fails, the calling query is aborted, and the current transaction is rolled back.