Make all command-line options of postmaster and postgres the same. See

http://archives.postgresql.org/pgsql-hackers/2006-01/msg00151.php for the
complete plan.
This commit is contained in:
Peter Eisentraut 2006-01-05 10:07:46 +00:00
parent 4e1712ea54
commit 86c23a6eb2
15 changed files with 607 additions and 556 deletions

View File

@ -1,5 +1,5 @@
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.41 2005/12/27 23:54:01 adunstan Exp $ $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.42 2006/01/05 10:07:44 petere Exp $
--> -->
<chapter Id="runtime-config"> <chapter Id="runtime-config">
<title>Server Configuration</title> <title>Server Configuration</title>
@ -2407,8 +2407,7 @@ SELECT * FROM parent WHERE key = 2400;
<para> <para>
Runs the server silently. If this option is set, the server Runs the server silently. If this option is set, the server
will automatically run in background and any controlling will automatically run in background and any controlling
terminals are disassociated (same effect as terminals are disassociated.
<command>postmaster</>'s <option>-S</option> option).
The server's standard output and standard error are redirected The server's standard output and standard error are redirected
to <literal>/dev/null</>, so any messages sent to them will be lost. to <literal>/dev/null</>, so any messages sent to them will be lost.
Unless <application>syslog</> logging is selected or Unless <application>syslog</> logging is selected or
@ -4054,6 +4053,19 @@ plruby.use_strict = true # generates error: unknown class name
</para> </para>
<variablelist> <variablelist>
<varlistentry id="guc-allow-system-table-mods" xreflabel="allow_system_table_mods">
<term><varname>allow_system_table_mods</varname> (<type>boolean</type>)</term>
<indexterm>
<primary><varname>allow_system_table_mods</varname> configuration parameter</primary>
</indexterm>
<listitem>
<para>
Allows the modification of the structure of system tables.
This is used by <command>initdb</command>.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-debug-assertions" xreflabel="debug_assertions"> <varlistentry id="guc-debug-assertions" xreflabel="debug_assertions">
<term><varname>debug_assertions</varname> (<type>boolean</type>)</term> <term><varname>debug_assertions</varname> (<type>boolean</type>)</term>
<indexterm> <indexterm>
@ -4075,6 +4087,35 @@ plruby.use_strict = true # generates error: unknown class name
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry id="guc-ignore-system-indexes" xreflabel="ignore_system_indexes">
<term><varname>ignore_system_indexes</varname> (<type>boolean</type>)</term>
<indexterm>
<primary><varname>ignore_system_indexes</varname> configuration parameter</primary>
</indexterm>
<listitem>
<para>
Ignore system indexes when reading system tables (but still
update the indexes when modifying the tables). This is useful
when recovering from damaged system indexes.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-post-auth-delay" xreflabel="post_auth_delay">
<term><varname>post_auth_delay</varname> (<type>integer</type>)</term>
<indexterm>
<primary><varname>post_auth_delay</> configuration parameter</primary>
</indexterm>
<listitem>
<para>
If nonzero, a delay of this many seconds occurs when a new
server process is started, after it conducts the
authentication procedure. This is intended to give an
opportunity to attach to the server process with a debugger.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-pre-auth-delay" xreflabel="pre_auth_delay"> <varlistentry id="guc-pre-auth-delay" xreflabel="pre_auth_delay">
<term><varname>pre_auth_delay</varname> (<type>integer</type>)</term> <term><varname>pre_auth_delay</varname> (<type>integer</type>)</term>
<indexterm> <indexterm>
@ -4082,11 +4123,11 @@ plruby.use_strict = true # generates error: unknown class name
</indexterm> </indexterm>
<listitem> <listitem>
<para> <para>
If nonzero, a delay of this many seconds occurs just after a new If nonzero, a delay of this many seconds occurs just after a
server process is forked, before it conducts the authentication new server process is forked, before it conducts the
process. This is intended to give an opportunity to attach to the authentication procedure. This is intended to give an
server process with a debugger to trace down misbehavior in opportunity to attach to the server process with a debugger to
authentication. trace down misbehavior in authentication.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -4182,9 +4223,12 @@ plruby.use_strict = true # generates error: unknown class name
<title>Short Options</title> <title>Short Options</title>
<para> <para>
For convenience there are also single letter command-line option switches For convenience there are also single letter command-line option
available for some parameters. They are described in <xref switches available for some parameters. They are described in
linkend="runtime-config-short-table">. <xref linkend="runtime-config-short-table">. Some of these
options exist for historical reasons, and their presence as a
single-letter option does not necessarily indicate an endorsement
to use the option heavily.
</para> </para>
<table id="runtime-config-short-table"> <table id="runtime-config-short-table">
@ -4198,6 +4242,10 @@ plruby.use_strict = true # generates error: unknown class name
</thead> </thead>
<tbody> <tbody>
<row>
<entry><option>-A <replaceable>x</replaceable></option></entry>
<entry><literal>debug_assertions = <replaceable>x</replaceable></></entry>
</row>
<row> <row>
<entry><option>-B <replaceable>x</replaceable></option></entry> <entry><option>-B <replaceable>x</replaceable></option></entry>
<entry><literal>shared_buffers = <replaceable>x</replaceable></></entry> <entry><literal>shared_buffers = <replaceable>x</replaceable></></entry>
@ -4206,6 +4254,26 @@ plruby.use_strict = true # generates error: unknown class name
<entry><option>-d <replaceable>x</replaceable></option></entry> <entry><option>-d <replaceable>x</replaceable></option></entry>
<entry><literal>log_min_messages = DEBUG<replaceable>x</replaceable></></entry> <entry><literal>log_min_messages = DEBUG<replaceable>x</replaceable></></entry>
</row> </row>
<row>
<entry><option>-e</option></entry>
<entry><literal>datestyle = euro</></entry>
</row>
<row>
<entry>
<option>-fb</option>, <option>-fh</option>, <option>-fi</option>,
<option>-fm</option>, <option>-fn</option>,
<option>-fs</option>, <option>-ft</option>
</entry>
<entry>
<literal>enable_bitmapscan = off</>,
<literal>enable_hashjoin = off</>,
<literal>enable_indexscan = off</>,
<literal>enable_mergejoin = off</>,
<literal>enable_nestloop = off</>,
<literal>enable_seqscan = off</>,
<literal>enable_tidscan = off</>
</entry>
</row>
<row> <row>
<entry><option>-F</option></entry> <entry><option>-F</option></entry>
<entry><literal>fsync = off</></entry> <entry><literal>fsync = off</></entry>
@ -4230,57 +4298,36 @@ plruby.use_strict = true # generates error: unknown class name
<entry><option>-N <replaceable>x</replaceable></option></entry> <entry><option>-N <replaceable>x</replaceable></option></entry>
<entry><literal>max_connections = <replaceable>x</replaceable></></entry> <entry><literal>max_connections = <replaceable>x</replaceable></></entry>
</row> </row>
<row>
<entry><option>-O</option></entry>
<entry><literal>allow_system_table_mods = on</></entry>
</row>
<row> <row>
<entry><option>-p <replaceable>x</replaceable></option></entry> <entry><option>-p <replaceable>x</replaceable></option></entry>
<entry><literal>port = <replaceable>x</replaceable></></entry> <entry><literal>port = <replaceable>x</replaceable></></entry>
</row> </row>
<row> <row>
<entry> <entry><option>-P</option></entry>
<option>-fb</option>, <option>-fh</option>, <option>-fi</option>, <entry><literal>ignore_system_indexes = on</></entry>
<option>-fm</option>, <option>-fn</option>,
<option>-fs</option>, <option>-ft</option><footnote
id="fn.runtime-config-short">
<para>
For historical reasons, these options must be passed to
the individual server process via the <option>-o</option>
<command>postmaster</command> option, for example,
<screen>
$ <userinput>postmaster -o '-S 1024 -s'</userinput>
</screen>
or via <envar>PGOPTIONS</envar> from the client side, as
explained above.
</para>
</footnote>
</entry>
<entry>
<literal>enable_bitmapscan = off</>,
<literal>enable_hashjoin = off</>,
<literal>enable_indexscan = off</>,
<literal>enable_mergejoin = off</>,
<literal>enable_nestloop = off</>,
<literal>enable_seqscan = off</>,
<literal>enable_tidscan = off</>
</entry>
</row> </row>
<row> <row>
<entry><option>-s</option><footnoteref linkend="fn.runtime-config-short"></entry> <entry><option>-s</option></entry>
<entry><literal>log_statement_stats = on</></entry> <entry><literal>log_statement_stats = on</></entry>
</row> </row>
<row> <row>
<entry><option>-S <replaceable>x</replaceable></option><footnoteref linkend="fn.runtime-config-short"> <entry><option>-S <replaceable>x</replaceable></option></entry>
</entry>
<entry><literal>work_mem = <replaceable>x</replaceable></></entry> <entry><literal>work_mem = <replaceable>x</replaceable></></entry>
</row> </row>
<row> <row>
<entry><option>-tpa</option>, <option>-tpl</option>, <option>-te</option><footnoteref linkend="fn.runtime-config-short"></entry> <entry><option>-tpa</option>, <option>-tpl</option>, <option>-te</option></entry>
<entry><literal>log_parser_stats = on</>, <entry><literal>log_parser_stats = on</>,
<literal>log_planner_stats = on</>, <literal>log_planner_stats = on</>,
<literal>log_executor_stats = on</></entry> <literal>log_executor_stats = on</></entry>
</row> </row>
<row>
<entry><option>-W <replaceable>x</replaceable></option></entry>
<entry><literal>post_auth_delay = <replaceable>x</replaceable></></entry>
</row>
</tbody> </tbody>
</tgroup> </tgroup>
</table> </table>

View File

@ -1,5 +1,5 @@
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.45 2004/11/15 06:32:15 neilc Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.46 2006/01/05 10:07:44 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
@ -21,53 +21,9 @@ PostgreSQL documentation
<refsynopsisdiv> <refsynopsisdiv>
<cmdsynopsis> <cmdsynopsis>
<!-- standalone call -->
<command>postgres</command> <command>postgres</command>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg> <arg rep="repeat"><replaceable>option</></arg>
<arg>-B <replaceable>nbuffers</replaceable></arg>
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<arg>-d <replaceable>debug-level</replaceable></arg>
<arg>--describe-config</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-e</arg>
<arg>-E</arg>
<arg>-f<group choice="plain"><arg>s</arg><arg>i</arg><arg>t</arg><arg>n</arg><arg>m</arg><arg>h</arg></group></arg>
<arg>-F</arg>
<arg>-N</arg>
<arg>-o <replaceable>filename</replaceable></arg>
<arg>-O</arg>
<arg>-P</arg>
<group>
<arg>-s</arg>
<arg>-t<group choice="plain"><arg>pa</arg><arg>pl</arg><arg>ex</arg></group></arg>
</group>
<arg>-S <replaceable>work-mem</replaceable></arg>
<arg>-W <replaceable>seconds</replaceable></arg>
<arg>--<replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<arg choice="plain"><replaceable>database</replaceable></arg> <arg choice="plain"><replaceable>database</replaceable></arg>
<sbr>
<!-- postmaster fork -->
<command>postgres</command>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg>
<arg>-B <replaceable>nbuffers</replaceable></arg>
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<arg>-d <replaceable>debug-level</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-e</arg>
<arg>-f<group choice="plain"><arg>s</arg><arg>i</arg><arg>t</arg><arg>n</arg><arg>m</arg><arg>h</arg></group></arg>
<arg>-F</arg>
<arg>-o <replaceable>filename</replaceable></arg>
<arg>-O</arg>
<arg>-p <replaceable>database</replaceable></arg>
<arg>-P</arg>
<group>
<arg>-s</arg>
<arg>-t<group choice="plain"><arg>pa</arg><arg>pl</arg><arg>ex</arg></group></arg>
</group>
<arg>-S <replaceable>work-mem</replaceable></arg>
<arg>-v <replaceable>protocol</replaceable></arg>
<arg>-W <replaceable>seconds</replaceable></arg>
<arg>--<replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
</cmdsynopsis> </cmdsynopsis>
</refsynopsisdiv> </refsynopsisdiv>
@ -77,23 +33,21 @@ PostgreSQL documentation
<para> <para>
The <command>postgres</command> executable is the actual The <command>postgres</command> executable is the actual
<productname>PostgreSQL</productname> server process that processes <productname>PostgreSQL</productname> server process that processes
queries. It is normally not called directly; instead a <xref SQL statements. It is normally not called directly; instead a
linkend="app-postmaster"> multiuser server is started. <xref linkend="app-postmaster"> multiuser server is started.
</para> Conceptually, the <command>postmaster</command> starts a new
<command>postgres</command> process for each connection.
<para> (<filename>postmaster</filename> and <filename>postgres</filename>
The second form above is how are in fact the same program, and on most platforms the connection
<command>postgres</command> is invoked by the <xref process is forked).
linkend="app-postmaster"> (only
conceptually, since both <filename>postmaster</filename> and
<filename>postgres</filename> are in fact the same program); it
should not be invoked directly this way. The first form invokes
the server directly in interactive single-user mode. The primary use
for this mode is during bootstrapping by <xref linkend="app-initdb">.
Sometimes it is used for debugging or disaster recovery.
</para> </para>
<para> <para>
If the <command>postgres</command> command is called directly, it
invokes the server in interactive single-user mode. The primary
use for this mode is during bootstrapping by <xref
linkend="app-initdb">. Sometimes it is used for debugging or
disaster recovery.
When invoked in interactive mode from the shell, the user can enter When invoked in interactive mode from the shell, the user can enter
queries and the results will be printed to the screen, but in a queries and the results will be printed to the screen, but in a
form that is more useful for developers than end users. But note form that is more useful for developers than end users. But note
@ -117,11 +71,9 @@ PostgreSQL documentation
<para> <para>
When <command>postgres</command> is started by a <xref When <command>postgres</command> is started by a <xref
linkend="app-postmaster"> then it linkend="app-postmaster"> then it inherits all options set by the
inherits all options set by the latter. Additionally, latter. In single-user mode, <command>postgres</command> accepts
<command>postgres</command>-specific options can be passed all the options that <command>postmaster</command> would accept.
from the <command>postmaster</command> with the
<option>-o</option> switch.
</para> </para>
<para> <para>
@ -141,74 +93,17 @@ PostgreSQL documentation
<para> <para>
The options <option>-A</option>, <option>-B</option>, The options <option>-A</option>, <option>-B</option>,
<option>-c</option>, <option>-d</option>, <option>-D</option>, <option>-c</option>, <option>-d</option>, <option>-D</option>,
<option>-F</option>, and <option>--<replaceable>name</></option> have the same meanings <option>-e</option>, <option>-F</option>, <option>-s</option>,
as the <xref linkend="app-postmaster"> except that <option>-S</option>, and <option>--<replaceable>name</></option>
<literal>-d 0</> prevents the server log level of have the same meanings as with the <xref linkend="app-postmaster">
the <command>postmaster</> from being propagated to <command>postgres</>. except that <literal>-d 0</> prevents the server log level of the
<command>postmaster</> from being propagated to
<command>postgres</>. Other <command>postmaster</command>
options are also accepted but will have no noticeable effect
because they only apply to the multiuser server mode, namely
<option>-h</option>, <option>-i</option>, <option>-k</option>,
<option>-l</option>, and <option>-n</option>.
</para> </para>
<variablelist>
<varlistentry>
<term><option>-e</option></term>
<listitem>
<para>
Sets the default date style to <quote>European</quote>, that is
<literal>DMY</> ordering of input date fields. This also causes
the day to be printed before the month in certain date output formats.
See <xref linkend="datatype-datetime"> for more information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> <replaceable class="parameter">filename</replaceable></term>
<listitem>
<para>
Send all server log output to
<replaceable class="parameter">filename</replaceable>.
If <command>postgres</command> is running under the
<command>postmaster</command>, this option is ignored,
and the <systemitem>stderr</> inherited from the
<command>postmaster</command> is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-P</option></term>
<listitem>
<para>
Ignore system indexes when reading system tables (but still update
the indexes when modifying the tables). This is useful when
recovering from damaged system indexes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option></term>
<listitem>
<para>
Print time information and other statistics at the end of each command.
This is useful for benchmarking or for use in tuning the number of
buffers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-S</option> <replaceable class="parameter">work-mem</replaceable></term>
<listitem>
<para>
Specifies the amount of memory to be used by internal sorts and hashes
before resorting to temporary disk files. See the description of the
<varname>work_mem</> configuration parameter in <xref
linkend="runtime-config-resource-memory">.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2> </refsect2>
<refsect2> <refsect2>
@ -235,13 +130,27 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-N</option></term> <term><option>-j</option></term>
<listitem> <listitem>
<para> <para>
Disables use of newline as a statement delimiter. Disables use of newline as a statement delimiter.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-r</option> <replaceable class="parameter">filename</replaceable></term>
<listitem>
<para>
Send all server log output to
<replaceable class="parameter">filename</replaceable>.
If <command>postgres</command> is running under the
<command>postmaster</command>, this option is ignored,
and the <systemitem>stderr</> inherited from the
<command>postmaster</command> is used.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect2> </refsect2>
@ -249,69 +158,13 @@ PostgreSQL documentation
<title>Semi-internal Options</title> <title>Semi-internal Options</title>
<para> <para>
There are several other options that may be specified, used The options <option>-f</option>, <option>-O</option>,
mainly for debugging purposes. These are listed here only for <option>-P</option>, <option>-t</option>, and <option>-W</option>
the use by <productname>PostgreSQL</productname> system have the same meanings as with the <xref
developers. <emphasis>Use of any of these options is highly linkend="app-postmaster"> and are reserved for debugging and
discouraged.</emphasis> Furthermore, any of these options may disaster recovery. Further options for internal use are:
disappear or change in a future release without notice.
</para>
<variablelist> <variablelist>
<varlistentry>
<term><option>-f</option> <literal>{ s | i | m | n | h }</literal></term>
<listitem>
<para>
Forbids the use of particular scan and join methods:
<literal>s</literal> and <literal>i</literal>
disable sequential and index scans respectively, while
<literal>n</literal>, <literal>m</literal>, and <literal>h</literal>
disable nested-loop, merge and hash joins respectively.
</para>
<note>
<para>
Neither sequential scans nor nested-loop joins can be disabled completely;
the <literal>-fs</literal> and <literal>-fn</literal>
options simply discourage the optimizer from using those
plan types if it has any other alternative.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-O</option></term>
<listitem>
<para>
Allows the structure of system tables to be modified. This is
used by <command>initdb</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-p</option> <replaceable class="parameter">database</replaceable></term>
<listitem>
<para>
Indicates that this process has been started by a
<command>postmaster</command> and specifies the database to use.
etc.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-t</option> <literal>pa[rser] | pl[anner] | e[xecutor]</literal></term>
<listitem>
<para>
Print timing statistics for each query relating to each of the
major system modules. This option cannot be used together
with the <option>-s</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>-v</option> <replaceable class="parameter">protocol</replaceable></term> <term><option>-v</option> <replaceable class="parameter">protocol</replaceable></term>
<listitem> <listitem>
@ -323,12 +176,12 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-W</option> <replaceable class="parameter">seconds</replaceable></term> <term><option>-y</option> <replaceable class="parameter">database</replaceable></term>
<listitem> <listitem>
<para> <para>
As soon as this option is encountered, the process sleeps for Indicates that this process has been started by a
the specified amount of seconds. This gives developers time <command>postmaster</command> and specifies the database to use.
to attach a debugger to the server process. etc.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -343,8 +196,8 @@ PostgreSQL documentation
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para>
</refsect2> </refsect2>
</refsect1> </refsect1>
@ -361,13 +214,7 @@ PostgreSQL documentation
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
<para>
For others, which have little influence during single-user mode,
see <xref linkend="app-postmaster">.
</para>
</refsect1> </refsect1>
<refsect1> <refsect1>
@ -423,7 +270,7 @@ PostgreSQL documentation
</para> </para>
<para> <para>
But if you use the <option>-N</> command line switch, then newline does But if you use the <option>-j</> command line switch, then newline does
not terminate command entry. In this case, the server will read the standard input not terminate command entry. In this case, the server will read the standard input
until the end-of-file (<acronym>EOF</>) marker, then until the end-of-file (<acronym>EOF</>) marker, then
process the input as a single command string. Backslash-newline is not process the input as a single command string. Backslash-newline is not
@ -434,7 +281,7 @@ PostgreSQL documentation
To quit the session, type <acronym>EOF</acronym> To quit the session, type <acronym>EOF</acronym>
(<keycombo action="simul"><keycap>Control</><keycap>D</></>, usually). (<keycombo action="simul"><keycap>Control</><keycap>D</></>, usually).
If you've If you've
used <option>-N</>, two consecutive <acronym>EOF</>s are needed to exit. used <option>-j</>, two consecutive <acronym>EOF</>s are needed to exit.
</para> </para>
<para> <para>

View File

@ -1,5 +1,5 @@
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.54 2005/12/02 23:13:46 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.55 2006/01/05 10:07:44 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
@ -22,22 +22,7 @@ PostgreSQL documentation
<refsynopsisdiv> <refsynopsisdiv>
<cmdsynopsis> <cmdsynopsis>
<command>postmaster</command> <command>postmaster</command>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg> <arg rep="repeat"><replaceable>option</></arg>
<arg>-B <replaceable>nbuffers</replaceable></arg>
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<arg>-d <replaceable>debug-level</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-F</arg>
<arg>-h <replaceable>hostname</replaceable></arg>
<arg>-i</arg>
<arg>-k <replaceable>directory</replaceable></arg>
<arg>-l</arg>
<arg>-N <replaceable>max-connections</replaceable></arg>
<arg>-o <replaceable>extra-options</replaceable></arg>
<arg>-p <replaceable>port</replaceable></arg>
<arg>-S</arg>
<arg>--<replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<group><arg>-n</arg><arg>-s</arg></group>
</cmdsynopsis> </cmdsynopsis>
</refsynopsisdiv> </refsynopsisdiv>
@ -70,8 +55,7 @@ PostgreSQL documentation
location (the <quote>data area</quote>). location (the <quote>data area</quote>).
More than one <command>postmaster</command> process can run on a system More than one <command>postmaster</command> process can run on a system
at one time, so long as they use different data areas and different at one time, so long as they use different data areas and different
communication ports (see below). A data area is created with <xref communication ports (see below).
linkend="app-initdb">.
</para> </para>
<para> <para>
@ -83,6 +67,7 @@ PostgreSQL documentation
directly to the data area directory created by <application>initdb</>. directly to the data area directory created by <application>initdb</>.
Other possible file layouts are discussed in Other possible file layouts are discussed in
<xref linkend="runtime-config-file-locations">. <xref linkend="runtime-config-file-locations">.
A data area is created with <xref linkend="app-initdb">.
</para> </para>
</refsect1> </refsect1>
@ -92,8 +77,12 @@ PostgreSQL documentation
<para> <para>
<command>postmaster</command> accepts the following <command>postmaster</command> accepts the following
command line arguments. For a detailed discussion of the options command line arguments. For a detailed discussion of the options
consult <xref linkend="runtime-config">. You can also save typing most of these consult <xref linkend="runtime-config">. You can save typing most of these
options by setting up a configuration file. options by setting up a configuration file.
</para>
<refsect2>
<title>General Purpose</title>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
@ -156,6 +145,18 @@ PostgreSQL documentation
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-e</option></term>
<listitem>
<para>
Sets the default date style to <quote>European</quote>, that is
<literal>DMY</> ordering of input date fields. This also causes
the day to be printed before the month in certain date output formats.
See <xref linkend="datatype-datetime"> for more information.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>-F</option></term> <term><option>-F</option></term>
<listitem> <listitem>
@ -264,6 +265,12 @@ PostgreSQL documentation
linkend="app-postgres"> for possibilities. If the option linkend="app-postgres"> for possibilities. If the option
string contains any spaces, the entire string must be quoted. string contains any spaces, the entire string must be quoted.
</para> </para>
<para>
The use of this option is obsolete; all command-line options
for server processes can be specified directly on the
<command>postmaster</command> command line
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -284,6 +291,17 @@ PostgreSQL documentation
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-s</option></term>
<listitem>
<para>
Print time information and other statistics at the end of each command.
This is useful for benchmarking or for use in tuning the number of
buffers.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>-S</option></term> <term><option>-S</option></term>
<listitem> <listitem>
@ -318,55 +336,124 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </refsect2>
<para> <refsect2>
Two additional command line options are available for debugging <title>Semi-internal Options</title>
problems that cause a server process to die abnormally. The
ordinary strategy in this situation is to notify all other server
processes that they must terminate and then reinitialize the
shared memory and semaphores. This is because an errant server
process could have corrupted some shared state before terminating.
These options select alternative behaviors of the
<command>postmaster</command> in this situation.
<emphasis>Neither option is intended for use in ordinary
operation.</emphasis>
</para>
<para> <para>
</para> There are several other options that may be specified, used
mainly for debugging purposes and in some cases to assist with
<para> recovery of severely damaged databases. There should be no reason
These special-case options are: to use them in a production database setup. These are listed
here only for the use by <productname>PostgreSQL</productname>
system developers. <emphasis>Use of any of these options is
highly discouraged.</emphasis> Furthermore, any of these options
may disappear or change in a future release without notice.
</para>
<variablelist> <variablelist>
<varlistentry>
<term><option>-f</option> <literal>{ s | i | m | n | h }</literal></term>
<listitem>
<para>
Forbids the use of particular scan and join methods:
<literal>s</literal> and <literal>i</literal>
disable sequential and index scans respectively, while
<literal>n</literal>, <literal>m</literal>, and <literal>h</literal>
disable nested-loop, merge and hash joins respectively.
</para>
<para>
Neither sequential scans nor nested-loop joins can be disabled
completely; the <literal>-fs</literal> and
<literal>-fn</literal> options simply discourage the optimizer
from using those plan types if it has any other alternative.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>-n</option></term> <term><option>-n</option></term>
<listitem> <listitem>
<para> <para>
<command>postmaster</command> This option is for debugging problems that cause a server
will not reinitialize shared data structures. A knowledgeable system process to die abnormally. The ordinary strategy in this
programmer can then use a debugger situation is to notify all other server processes that they
to examine shared memory and semaphore state. must terminate and then reinitialize the shared memory and
semaphores. This is because an errant server process could
have corrupted some shared state before terminating. This
option specifies that the <command>postmaster</command> will
not reinitialize shared data structures. A knowledgeable
system programmer can then use a debugger to examine shared
memory and semaphore state.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-s</option></term> <term><option>-O</option></term>
<listitem> <listitem>
<para> <para>
<command>postmaster</command> Allows the structure of system tables to be modified. This is
will stop all other server processes by sending the signal used by <command>initdb</command>.
<literal>SIGSTOP</literal>, </para>
but will not cause them to terminate. This permits system programmers </listitem>
to collect core dumps from all server processes by hand. </varlistentry>
<varlistentry>
<term><option>-P</option></term>
<listitem>
<para>
Ignore system indexes when reading system tables (but still update
the indexes when modifying the tables). This is useful when
recovering from damaged system indexes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-t</option> <literal>pa[rser] | pl[anner] | e[xecutor]</literal></term>
<listitem>
<para>
Print timing statistics for each query relating to each of the
major system modules. This option cannot be used together
with the <option>-s</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-T</option></term>
<listitem>
<para>
This option is for debugging problems that cause a server
process to die abnormally. The ordinary strategy in this
situation is to notify all other server processes that they
must terminate and then reinitialize the shared memory and
semaphores. This is because an errant server process could
have corrupted some shared state before terminating. This
option specifies that the <command>postmaster</command> will
stop all other server processes by sending the signal
<literal>SIGSTOP</literal>, but will not cause them to
terminate. This permits system programmers to collect core
dumps from all server processes by hand.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-W</option> <replaceable class="parameter">seconds</replaceable></term>
<listitem>
<para>
A delay of this many seconds occurs when a new server process
is started, after it conducts the authentication procedure.
This is intended to give an opportunity to attach to the
server process with a debugger.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.52 2005/12/03 05:51:00 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.53 2006/01/05 10:07:44 petere Exp $
* *
* NOTES * NOTES
* many of the old access method routines have been turned into * many of the old access method routines have been turned into
@ -185,7 +185,7 @@ systable_beginscan(Relation heapRelation,
Relation irel; Relation irel;
if (indexOK && if (indexOK &&
!IsIgnoringSystemIndexes() && !IgnoreSystemIndexes &&
!ReindexIsProcessingIndex(indexId)) !ReindexIsProcessingIndex(indexId))
irel = index_open(indexId); irel = index_open(indexId);
else else

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.210 2006/01/04 21:06:30 tgl Exp $ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.211 2006/01/05 10:07:44 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -255,10 +255,13 @@ BootstrapMain(int argc, char *argv[])
argc--; argc--;
} }
while ((flag = getopt(argc, argv, "B:c:d:D:Fo:p:x:-:")) != -1) while ((flag = getopt(argc, argv, "B:c:d:D:Fr:x:y:-:")) != -1)
{ {
switch (flag) switch (flag)
{ {
case 'B':
SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'D': case 'D':
userDoption = optarg; userDoption = optarg;
break; break;
@ -278,18 +281,15 @@ BootstrapMain(int argc, char *argv[])
case 'F': case 'F':
SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'o': case 'r':
StrNCpy(OutputFileName, optarg, MAXPGPATH); StrNCpy(OutputFileName, optarg, MAXPGPATH);
break; break;
case 'x': case 'x':
xlogop = atoi(optarg); xlogop = atoi(optarg);
break; break;
case 'p': case 'y':
dbname = strdup(optarg); dbname = strdup(optarg);
break; break;
case 'B':
SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'c': case 'c':
case '-': case '-':
{ {
@ -376,7 +376,7 @@ BootstrapMain(int argc, char *argv[])
CreateDataDirLockFile(false); CreateDataDirLockFile(false);
SetProcessingMode(BootstrapProcessing); SetProcessingMode(BootstrapProcessing);
IgnoreSystemIndexes(true); IgnoreSystemIndexes = true;
BaseInit(); BaseInit();
@ -499,14 +499,16 @@ BootstrapMain(int argc, char *argv[])
static void static void
usage(void) usage(void)
{ {
write_stderr("Usage:\n" fprintf(stderr, _("This is the PostgreSQL bootstrap process.\n\n"));
" postgres -boot [OPTION]... DBNAME\n" fprintf(stderr, _("Usage:\n postgres -boot [OPTION]... DBNAME\n\n"));
" -c NAME=VALUE set run-time parameter\n" fprintf(stderr, _("Options:\n"));
" -d 1-5 debug level\n" fprintf(stderr, _(" -B NBUFFERS number of shared buffers\n"));
" -D datadir data directory\n" fprintf(stderr, _(" -c NAME=VALUE set run-time parameter\n"));
" -F turn off fsync\n" fprintf(stderr, _(" -d 1-5 debugging level\n"));
" -o file send debug output to file\n" fprintf(stderr, _(" -D DATADIR database directory\n"));
" -x num internal use\n"); fprintf(stderr, _(" -F turn fsync off\n"));
fprintf(stderr, _(" -r FILENAME send stdout and stderr to given file\n"));
fprintf(stderr, _(" -x NUM internal use\n"));
proc_exit(1); proc_exit(1);
} }

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.197 2005/11/22 18:17:09 momjian Exp $ * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.198 2006/01/05 10:07:45 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -845,7 +845,7 @@ RelationBuildTriggers(Relation relation)
/* /*
* Note: since we scan the triggers using TriggerRelidNameIndexId, we will * Note: since we scan the triggers using TriggerRelidNameIndexId, we will
* be reading the triggers in name order, except possibly during * be reading the triggers in name order, except possibly during
* emergency-recovery operations (ie, IsIgnoringSystemIndexes). This in * emergency-recovery operations (ie, IgnoreSystemIndexes). This in
* turn ensures that triggers will be fired in name order. * turn ensures that triggers will be fired in name order.
*/ */
ScanKeyInit(&skey, ScanKeyInit(&skey,

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.115 2005/11/22 18:17:14 momjian Exp $ * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.116 2006/01/05 10:07:45 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -107,7 +107,7 @@ get_relation_info(Oid relationObjectId, RelOptInfo *rel)
/* /*
* Make list of indexes. Ignore indexes on system catalogs if told to. * Make list of indexes. Ignore indexes on system catalogs if told to.
*/ */
if (IsIgnoringSystemIndexes() && IsSystemClass(relation->rd_rel)) if (IgnoreSystemIndexes && IsSystemClass(relation->rd_rel))
hasindex = false; hasindex = false;
else else
hasindex = relation->rd_rel->relhasindex; hasindex = relation->rd_rel->relhasindex;

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.477 2006/01/04 21:06:31 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.478 2006/01/05 10:07:45 petere Exp $
* *
* NOTES * NOTES
* *
@ -432,8 +432,6 @@ PostmasterMain(int argc, char *argv[])
ALLOCSET_DEFAULT_MAXSIZE); ALLOCSET_DEFAULT_MAXSIZE);
MemoryContextSwitchTo(PostmasterContext); MemoryContextSwitchTo(PostmasterContext);
IgnoreSystemIndexes(false);
if (find_my_exec(argv[0], my_exec_path) < 0) if (find_my_exec(argv[0], my_exec_path) < 0)
elog(FATAL, "%s: could not locate my own executable path", elog(FATAL, "%s: could not locate my own executable path",
argv[0]); argv[0]);
@ -447,90 +445,108 @@ PostmasterMain(int argc, char *argv[])
opterr = 1; opterr = 1;
while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1) while ((opt = getopt(argc, argv, "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)
{ {
switch (opt) switch (opt)
{ {
case 'A': case 'A':
#ifdef USE_ASSERT_CHECKING
SetConfigOption("debug_assertions", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("debug_assertions", optarg, PGC_POSTMASTER, PGC_S_ARGV);
#else
write_stderr("%s: assert checking is not compiled in\n", progname);
#endif
break;
case 'a':
/* Can no longer set authentication method. */
break; break;
case 'B': case 'B':
SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'b':
/* Can no longer set the backend executable file to use. */
break;
case 'D': case 'D':
userDoption = optarg; userDoption = optarg;
break; break;
case 'd': case 'd':
set_debug_options(atoi(optarg), PGC_POSTMASTER, PGC_S_ARGV); set_debug_options(atoi(optarg), PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'E':
SetConfigOption("log_statement", "all", PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'e':
SetConfigOption("datestyle", "euro", PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'F': case 'F':
SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'f':
if (!set_plan_disabling_options(optarg, PGC_POSTMASTER, PGC_S_ARGV))
{
write_stderr("%s: invalid argument for option -f: \"%s\"\n",
progname, optarg);
ExitPostmaster(1);
}
break;
case 'h': case 'h':
SetConfigOption("listen_addresses", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("listen_addresses", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'i': case 'i':
SetConfigOption("listen_addresses", "*", PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("listen_addresses", "*", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'j':
/* only used by interactive backend */
break;
case 'k': case 'k':
SetConfigOption("unix_socket_directory", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("unix_socket_directory", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break; break;
#ifdef USE_SSL
case 'l': case 'l':
SetConfigOption("ssl", "true", PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("ssl", "true", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
#endif
case 'm':
/* Multiplexed backends no longer supported. */
break;
case 'M':
/*
* ignore this flag. This may be passed in because the
* program was run as 'postgres -M' instead of 'postmaster'
*/
break;
case 'N': case 'N':
/* The max number of backends to start. */
SetConfigOption("max_connections", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("max_connections", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'n': case 'n':
/* Don't reinit shared mem after abnormal exit */ /* Don't reinit shared mem after abnormal exit */
Reinit = false; Reinit = false;
break; break;
case 'o':
/* case 'O':
* Other options to pass to the backend on the command line SetConfigOption("allow_system_table_mods", "true", PGC_POSTMASTER, PGC_S_ARGV);
*/ break;
case 'o':
/* Other options to pass to the backend on the command line */
snprintf(ExtraOptions + strlen(ExtraOptions), snprintf(ExtraOptions + strlen(ExtraOptions),
sizeof(ExtraOptions) - strlen(ExtraOptions), sizeof(ExtraOptions) - strlen(ExtraOptions),
" %s", optarg); " %s", optarg);
break; break;
case 'P':
SetConfigOption("ignore_system_indexes", "true", PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'p': case 'p':
SetConfigOption("port", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("port", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'S':
/* case 'r':
* Start in 'S'ilent mode (disassociate from controlling tty). /* only used by single-user backend */
* You may also think of this as 'S'ysV mode since it's most
* badly needed on SysV-derived systems like SVR4 and HP-UX.
*/
SetConfigOption("silent_mode", "true", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 's':
case 'S':
SetConfigOption("work_mem", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
case 's':
SetConfigOption("log_statement_stats", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'T':
/* /*
* In the event that some backend dumps core, send SIGSTOP, * In the event that some backend dumps core, send SIGSTOP,
* rather than SIGQUIT, to all its peers. This lets the wily * rather than SIGQUIT, to all its peers. This lets the wily
@ -538,6 +554,28 @@ PostmasterMain(int argc, char *argv[])
*/ */
SendStop = true; SendStop = true;
break; break;
case 't':
{
const char *tmp = get_stats_option_name(optarg);
if (tmp)
{
SetConfigOption(tmp, "true", PGC_POSTMASTER, PGC_S_ARGV);
}
else
{
write_stderr("%s: invalid argument for option -t: \"%s\"\n",
progname, optarg);
ExitPostmaster(1);
}
break;
}
case 'W':
SetConfigOption("post_auth_delay", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'c': case 'c':
case '-': case '-':
{ {
@ -1113,6 +1151,7 @@ usage(const char *progname)
printf(_(" -c NAME=VALUE set run-time parameter\n")); printf(_(" -c NAME=VALUE set run-time parameter\n"));
printf(_(" -d 1-5 debugging level\n")); printf(_(" -d 1-5 debugging level\n"));
printf(_(" -D DATADIR database directory\n")); printf(_(" -D DATADIR database directory\n"));
printf(_(" -e use European date input format (DMY)\n"));
printf(_(" -F turn fsync off\n")); printf(_(" -F turn fsync off\n"));
printf(_(" -h HOSTNAME host name or IP address to listen on\n")); printf(_(" -h HOSTNAME host name or IP address to listen on\n"));
printf(_(" -i enable TCP/IP connections\n")); printf(_(" -i enable TCP/IP connections\n"));
@ -1121,18 +1160,25 @@ usage(const char *progname)
printf(_(" -l enable SSL connections\n")); printf(_(" -l enable SSL connections\n"));
#endif #endif
printf(_(" -N MAX-CONNECT maximum number of allowed connections\n")); printf(_(" -N MAX-CONNECT maximum number of allowed connections\n"));
printf(_(" -o OPTIONS pass \"OPTIONS\" to each server process\n")); printf(_(" -o OPTIONS pass \"OPTIONS\" to each server process (obsolete)\n"));
printf(_(" -p PORT port number to listen on\n")); printf(_(" -p PORT port number to listen on\n"));
printf(_(" -S silent mode (start in background without logging output)\n")); printf(_(" -s show statistics after each query\n"));
printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n"));
printf(_(" --NAME=VALUE set run-time parameter\n"));
printf(_(" --help show this help, then exit\n")); printf(_(" --help show this help, then exit\n"));
printf(_(" --version output version information, then exit\n")); printf(_(" --version output version information, then exit\n"));
printf(_("\nDeveloper options:\n")); printf(_("\nDeveloper options:\n"));
printf(_(" -f s|i|n|m|h forbid use of some plan types\n"));
printf(_(" -n do not reinitialize shared memory after abnormal exit\n")); printf(_(" -n do not reinitialize shared memory after abnormal exit\n"));
printf(_(" -s send SIGSTOP to all backend servers if one dies\n")); printf(_(" -O allow system table structure changes\n"));
printf(_(" -P disable system indexes\n"));
printf(_(" -t pa|pl|ex show timings after each query\n"));
printf(_(" -T send SIGSTOP to all backend servers if one dies\n"));
printf(_(" -W NUM wait NUM seconds to allow attach from a debugger\n"));
printf(_("\nPlease read the documentation for the complete list of run-time\n" printf(_("\nPlease read the documentation for the complete list of run-time\n"
"configuration settings and how to set them on the command line or in\n" "configuration settings and how to set them on the command line or in\n"
"the configuration file.\n\n" "the configuration file.\n\n"
"Report bugs to <pgsql-bugs@postgresql.org>.\n")); "Report bugs to <pgsql-bugs@postgresql.org>.\n"));
} }
@ -2797,8 +2843,8 @@ BackendRun(Port *port)
* Now, build the argv vector that will be given to PostgresMain. * Now, build the argv vector that will be given to PostgresMain.
* *
* The layout of the command line is * The layout of the command line is
* postgres [secure switches] -p databasename [insecure switches] * postgres [secure switches] -y databasename [insecure switches]
* where the switches after -p come from the client request. * where the switches after -y come from the client request.
* *
* The maximum possible number of commandline arguments that could come * The maximum possible number of commandline arguments that could come
* from ExtraOptions or port->cmdline_options is (strlen + 1) / 2; see * from ExtraOptions or port->cmdline_options is (strlen + 1) / 2; see
@ -2829,9 +2875,9 @@ BackendRun(Port *port)
/* /*
* Tell the backend it is being called from the postmaster, and which * Tell the backend it is being called from the postmaster, and which
* database to use. -p marks the end of secure switches. * database to use. -y marks the end of secure switches.
*/ */
av[ac++] = "-p"; av[ac++] = "-y";
av[ac++] = port->database_name; av[ac++] = port->database_name;
/* /*
@ -3575,7 +3621,7 @@ StartChildProcess(int xlop)
snprintf(xlbuf, sizeof(xlbuf), "-x%d", xlop); snprintf(xlbuf, sizeof(xlbuf), "-x%d", xlop);
av[ac++] = xlbuf; av[ac++] = xlbuf;
av[ac++] = "-p"; av[ac++] = "-y";
av[ac++] = "template1"; av[ac++] = "template1";
av[ac] = NULL; av[ac] = NULL;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.476 2006/01/05 03:01:35 momjian Exp $ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.477 2006/01/05 10:07:45 petere Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
@ -84,6 +84,10 @@ LogStmtLevel log_statement = LOGSTMT_NONE;
/* GUC variable for maximum stack depth (measured in kilobytes) */ /* GUC variable for maximum stack depth (measured in kilobytes) */
int max_stack_depth = 2048; int max_stack_depth = 2048;
/* wait N seconds to allow attach from a debugger */
int PostAuthDelay = 0;
/* ---------------- /* ----------------
* private variables * private variables
@ -2338,30 +2342,30 @@ usage(const char *progname)
{ {
printf(_("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n"), progname); printf(_("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n"), progname);
printf(_("Usage:\n %s [OPTION]... [DBNAME]\n\n"), progname); printf(_("Usage:\n %s [OPTION]... DBNAME\n\n"), progname);
printf(_("Options:\n")); printf(_("Options:\n"));
#ifdef USE_ASSERT_CHECKING #ifdef USE_ASSERT_CHECKING
printf(_(" -A 1|0 enable/disable run-time assert checking\n")); printf(_(" -A 1|0 enable/disable run-time assert checking\n"));
#endif #endif
printf(_(" -B NBUFFERS number of shared buffers\n")); printf(_(" -B NBUFFERS number of shared buffers\n"));
printf(_(" -c NAME=VALUE set run-time parameter\n")); printf(_(" -c NAME=VALUE set run-time parameter\n"));
printf(_(" -d 0-5 debugging level (0 is off)\n")); printf(_(" -d 0-5 debugging level\n"));
printf(_(" -D DATADIR database directory\n")); printf(_(" -D DATADIR database directory\n"));
printf(_(" -e use European date input format (DMY)\n")); printf(_(" -e use European date input format (DMY)\n"));
printf(_(" -E echo query before execution\n")); printf(_(" -E echo statement before execution\n"));
printf(_(" -F turn fsync off\n")); printf(_(" -F turn fsync off\n"));
printf(_(" -N do not use newline as interactive query delimiter\n")); printf(_(" -j do not use newline as interactive query delimiter\n"));
printf(_(" -o FILENAME send stdout and stderr to given file\n")); printf(_(" -r FILENAME send stdout and stderr to given file\n"));
printf(_(" -P disable system indexes\n"));
printf(_(" -s show statistics after each query\n")); printf(_(" -s show statistics after each query\n"));
printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n")); printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n"));
printf(_(" --NAME=VALUE set run-time parameter\n"));
printf(_(" --describe-config describe configuration parameters, then exit\n")); printf(_(" --describe-config describe configuration parameters, then exit\n"));
printf(_(" --help show this help, then exit\n")); printf(_(" --help show this help, then exit\n"));
printf(_(" --version output version information, then exit\n")); printf(_(" --version output version information, then exit\n"));
printf(_("\nDeveloper options:\n")); printf(_("\nDeveloper options:\n"));
printf(_(" -f s|i|n|m|h forbid use of some plan types\n")); printf(_(" -f s|i|n|m|h forbid use of some plan types\n"));
printf(_(" -i do not execute queries\n"));
printf(_(" -O allow system table structure changes\n")); printf(_(" -O allow system table structure changes\n"));
printf(_(" -P disable system indexes\n"));
printf(_(" -t pa|pl|ex show timings after each query\n")); printf(_(" -t pa|pl|ex show timings after each query\n"));
printf(_(" -W NUM wait NUM seconds to allow attach from a debugger\n")); printf(_(" -W NUM wait NUM seconds to allow attach from a debugger\n"));
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n")); printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
@ -2403,6 +2407,66 @@ set_debug_options(int debug_flag, GucContext context, GucSource source)
} }
bool
set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
{
char *tmp = NULL;
switch (arg[0])
{
case 's': /* seqscan */
tmp = "enable_seqscan";
break;
case 'i': /* indexscan */
tmp = "enable_indexscan";
break;
case 'b': /* bitmapscan */
tmp = "enable_bitmapscan";
break;
case 't': /* tidscan */
tmp = "enable_tidscan";
break;
case 'n': /* nestloop */
tmp = "enable_nestloop";
break;
case 'm': /* mergejoin */
tmp = "enable_mergejoin";
break;
case 'h': /* hashjoin */
tmp = "enable_hashjoin";
break;
}
if (tmp)
{
SetConfigOption(tmp, "false", context, source);
return true;
}
else
return false;
}
const char *
get_stats_option_name(const char *arg)
{
switch (arg[0])
{
case 'p':
if (optarg[1] == 'a') /* "parser" */
return "log_parser_stats";
else if (optarg[1] == 'l') /* "planner" */
return "log_planner_stats";
break;
case 'e': /* "executor" */
return "log_executor_stats";
break;
}
return NULL;
}
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* PostgresMain * PostgresMain
* postgres main loop -- all backends, interactive or otherwise start here * postgres main loop -- all backends, interactive or otherwise start here
@ -2427,7 +2491,6 @@ PostgresMain(int argc, char *argv[], const char *username)
GucContext ctx; GucContext ctx;
GucSource gucsource; GucSource gucsource;
bool am_superuser; bool am_superuser;
char *tmp;
int firstchar; int firstchar;
char stack_base; char stack_base;
StringInfoData input_message; StringInfoData input_message;
@ -2518,164 +2581,100 @@ PostgresMain(int argc, char *argv[], const char *username)
ctx = PGC_POSTMASTER; ctx = PGC_POSTMASTER;
gucsource = PGC_S_ARGV; /* initial switches came from command line */ gucsource = PGC_S_ARGV; /* initial switches came from command line */
while ((flag = getopt(argc, argv, "A:B:c:D:d:Eef:FiNOPo:p:S:st:v:W:-:")) != -1) while ((flag = getopt(argc, argv, "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:v:W:y:-:")) != -1)
{ {
switch (flag) switch (flag)
{ {
case 'A': case 'A':
#ifdef USE_ASSERT_CHECKING
SetConfigOption("debug_assertions", optarg, ctx, gucsource); SetConfigOption("debug_assertions", optarg, ctx, gucsource);
#else
ereport(WARNING,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("assert checking is not compiled in")));
#endif
break; break;
case 'B': case 'B':
/*
* specify the size of buffer pool
*/
SetConfigOption("shared_buffers", optarg, ctx, gucsource); SetConfigOption("shared_buffers", optarg, ctx, gucsource);
break; break;
case 'D': /* PGDATA or config directory */ case 'D':
if (secure) if (secure)
userDoption = optarg; userDoption = optarg;
break; break;
case 'd': /* debug level */ case 'd':
debug_flag = atoi(optarg); debug_flag = atoi(optarg);
break; break;
case 'E': case 'E':
/*
* E - echo the query the user entered
*/
EchoQuery = true; EchoQuery = true;
break; break;
case 'e': case 'e':
/*
* Use European date input format (DMY)
*/
SetConfigOption("datestyle", "euro", ctx, gucsource); SetConfigOption("datestyle", "euro", ctx, gucsource);
break; break;
case 'F': case 'F':
/*
* turn off fsync
*/
SetConfigOption("fsync", "false", ctx, gucsource); SetConfigOption("fsync", "false", ctx, gucsource);
break; break;
case 'f': case 'f':
if (!set_plan_disabling_options(optarg, ctx, gucsource))
/* errs++;
* f - forbid generation of certain plans
*/
tmp = NULL;
switch (optarg[0])
{
case 's': /* seqscan */
tmp = "enable_seqscan";
break;
case 'i': /* indexscan */
tmp = "enable_indexscan";
break;
case 'b': /* bitmapscan */
tmp = "enable_bitmapscan";
break;
case 't': /* tidscan */
tmp = "enable_tidscan";
break;
case 'n': /* nestloop */
tmp = "enable_nestloop";
break;
case 'm': /* mergejoin */
tmp = "enable_mergejoin";
break;
case 'h': /* hashjoin */
tmp = "enable_hashjoin";
break;
default:
errs++;
}
if (tmp)
SetConfigOption(tmp, "false", ctx, gucsource);
break; break;
case 'N': case 'h':
SetConfigOption("listen_addresses", optarg, ctx, gucsource);
break;
/* case 'i':
* N - Don't use newline as a query delimiter SetConfigOption("listen_addresses", "*", ctx, gucsource);
*/ break;
case 'j':
UseNewLine = 0; UseNewLine = 0;
break; break;
case 'O': case 'k':
SetConfigOption("unix_socket_directory", optarg, ctx, gucsource);
/*
* allow system table structure modifications
*/
if (secure) /* XXX safe to allow from client??? */
allowSystemTableMods = true;
break; break;
case 'P': case 'l':
SetConfigOption("ssl", "true", ctx, gucsource);
break;
/* case 'N':
* ignore system indexes SetConfigOption("max_connections", optarg, ctx, gucsource);
* break;
* As of PG 7.4 this is safe to allow from the client, since
* it only disables reading the system indexes, not writing case 'n':
* them. Worst case consequence is slowness. /* ignored for consistency with postmaster */
*/ break;
IgnoreSystemIndexes(true);
case 'O':
SetConfigOption("allow_system_table_mods", "true", ctx, gucsource);
break; break;
case 'o': case 'o':
errs++;
break;
/* case 'P':
* o - send output (stdout and stderr) to the given file SetConfigOption("ignore_system_indexes", "true", ctx, gucsource);
*/ break;
case 'p':
SetConfigOption("port", optarg, ctx, gucsource);
break;
case 'r':
/* send output (stdout and stderr) to the given file */
if (secure) if (secure)
StrNCpy(OutputFileName, optarg, MAXPGPATH); StrNCpy(OutputFileName, optarg, MAXPGPATH);
break; break;
case 'p':
/*
* p - special flag passed if backend was forked by a
* postmaster.
*/
if (secure)
{
dbname = strdup(optarg);
secure = false; /* subsequent switches are NOT secure */
ctx = PGC_BACKEND;
gucsource = PGC_S_CLIENT;
}
break;
case 'S': case 'S':
/*
* S - amount of sort memory to use in 1k bytes
*/
SetConfigOption("work_mem", optarg, ctx, gucsource); SetConfigOption("work_mem", optarg, ctx, gucsource);
break; break;
case 's': case 's':
/* /*
* s - report usage statistics (timings) after each query
*
* Since log options are SUSET, we need to postpone unless * Since log options are SUSET, we need to postpone unless
* still in secure context * still in secure context
*/ */
@ -2686,35 +2685,13 @@ PostgresMain(int argc, char *argv[], const char *username)
ctx, gucsource); ctx, gucsource);
break; break;
case 'T':
/* ignored for consistency with postmaster */
break;
case 't': case 't':
/* --------------- {
* tell postgres to report usage statistics (timings) for const char *tmp = get_stats_option_name(optarg);
* each query
*
* -tpa[rser] = print stats for parser time of each query
* -tpl[anner] = print stats for planner time of each query
* -te[xecutor] = print stats for executor time of each query
* caution: -s can not be used together with -t.
* ----------------
*/
tmp = NULL;
switch (optarg[0])
{
case 'p':
if (optarg[1] == 'a')
tmp = "log_parser_stats";
else if (optarg[1] == 'l')
tmp = "log_planner_stats";
else
errs++;
break;
case 'e':
tmp = "log_executor_stats";
break;
default:
errs++;
break;
}
if (tmp) if (tmp)
{ {
if (ctx == PGC_BACKEND) if (ctx == PGC_BACKEND)
@ -2722,7 +2699,10 @@ PostgresMain(int argc, char *argv[], const char *username)
else else
SetConfigOption(tmp, "true", ctx, gucsource); SetConfigOption(tmp, "true", ctx, gucsource);
} }
else
errs++;
break; break;
}
case 'v': case 'v':
if (secure) if (secure)
@ -2730,11 +2710,23 @@ PostgresMain(int argc, char *argv[], const char *username)
break; break;
case 'W': case 'W':
SetConfigOption("post_auth_delay", optarg, ctx, gucsource);
break;
case 'y':
/* /*
* wait N seconds to allow attach from a debugger * y - special flag passed if backend was forked by a
* postmaster.
*/ */
pg_usleep(atoi(optarg) * 1000000L); if (secure)
{
dbname = strdup(optarg);
secure = false; /* subsequent switches are NOT secure */
ctx = PGC_BACKEND;
gucsource = PGC_S_CLIENT;
}
break; break;
case 'c': case 'c':
@ -2813,6 +2805,9 @@ PostgresMain(int argc, char *argv[], const char *username)
pg_timezone_initialize(); pg_timezone_initialize();
} }
if (PostAuthDelay)
pg_usleep(PostAuthDelay * 1000000L);
/* /*
* Set up signal handlers and masks. * Set up signal handlers and masks.
* *

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.233 2005/12/09 01:22:04 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.234 2006/01/05 10:07:46 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -551,7 +551,7 @@ RelationBuildRuleLock(Relation relation)
* *
* Note: since we scan the rules using RewriteRelRulenameIndexId, we will * Note: since we scan the rules using RewriteRelRulenameIndexId, we will
* be reading the rules in name order, except possibly during * be reading the rules in name order, except possibly during
* emergency-recovery operations (ie, IsIgnoringSystemIndexes). This in * emergency-recovery operations (ie, IgnoreSystemIndexes). This in
* turn ensures that rules will be fired in name order. * turn ensures that rules will be fired in name order.
*/ */
rewrite_desc = heap_open(RewriteRelationId, AccessShareLock); rewrite_desc = heap_open(RewriteRelationId, AccessShareLock);

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.152 2006/01/05 03:01:36 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.153 2006/01/05 10:07:46 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -62,27 +62,7 @@ static char socketLockFile[MAXPGPATH];
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
static bool isIgnoringSystemIndexes = false; bool IgnoreSystemIndexes = false;
/*
* IsIgnoringSystemIndexes
* True if ignoring system indexes.
*/
bool
IsIgnoringSystemIndexes(void)
{
return isIgnoringSystemIndexes;
}
/*
* IgnoreSystemIndexes
* Set true or false whether PostgreSQL ignores system indexes.
*/
void
IgnoreSystemIndexes(bool mode)
{
isIgnoringSystemIndexes = mode;
}
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* system index reindexing support * system index reindexing support

View File

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.305 2005/12/30 00:13:50 petere Exp $ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.306 2006/01/05 10:07:46 petere Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
@ -130,6 +130,7 @@ static const char *show_num_temp_buffers(void);
static bool assign_phony_autocommit(bool newval, bool doit, GucSource source); static bool assign_phony_autocommit(bool newval, bool doit, GucSource source);
static const char *assign_custom_variable_classes(const char *newval, bool doit, static const char *assign_custom_variable_classes(const char *newval, bool doit,
GucSource source); GucSource source);
static bool assign_debug_assertions(bool newval, bool doit, GucSource source);
static bool assign_ssl(bool newval, bool doit, GucSource source); static bool assign_ssl(bool newval, bool doit, GucSource source);
static bool assign_stage_log_stats(bool newval, bool doit, GucSource source); static bool assign_stage_log_stats(bool newval, bool doit, GucSource source);
static bool assign_log_stats(bool newval, bool doit, GucSource source); static bool assign_log_stats(bool newval, bool doit, GucSource source);
@ -316,7 +317,7 @@ const char *const config_group_names[] =
/* STATS_COLLECTOR */ /* STATS_COLLECTOR */
gettext_noop("Statistics / Query and Index Statistics Collector"), gettext_noop("Statistics / Query and Index Statistics Collector"),
/* AUTOVACUUM */ /* AUTOVACUUM */
gettext_noop("Auto Vacuum"), gettext_noop("Autovacuum"),
/* CLIENT_CONN */ /* CLIENT_CONN */
gettext_noop("Client Connection Defaults"), gettext_noop("Client Connection Defaults"),
/* CLIENT_CONN_STATEMENT */ /* CLIENT_CONN_STATEMENT */
@ -560,8 +561,6 @@ static struct config_bool ConfigureNamesBool[] =
&Log_disconnections, &Log_disconnections,
false, NULL, NULL false, NULL, NULL
}, },
#ifdef USE_ASSERT_CHECKING
{ {
{"debug_assertions", PGC_USERSET, DEVELOPER_OPTIONS, {"debug_assertions", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Turns on various assertion checks."), gettext_noop("Turns on various assertion checks."),
@ -569,10 +568,13 @@ static struct config_bool ConfigureNamesBool[] =
GUC_NOT_IN_SAMPLE GUC_NOT_IN_SAMPLE
}, },
&assert_enabled, &assert_enabled,
true, NULL, NULL #ifdef USE_ASSERT_CHECKING
}, true,
#else
false,
#endif #endif
assign_debug_assertions, NULL
},
{ {
/* currently undocumented, so don't show in SHOW ALL */ /* currently undocumented, so don't show in SHOW ALL */
{"exit_on_error", PGC_USERSET, UNGROUPED, {"exit_on_error", PGC_USERSET, UNGROUPED,
@ -978,6 +980,27 @@ static struct config_bool ConfigureNamesBool[] =
false, NULL, NULL false, NULL, NULL
}, },
{
{"allow_system_table_mods", PGC_BACKEND, DEVELOPER_OPTIONS,
gettext_noop("Allows modifications of the structure of system tables."),
NULL,
GUC_NOT_IN_SAMPLE
},
&allowSystemTableMods,
false, NULL, NULL
},
{
{"ignore_system_indexes", PGC_BACKEND, DEVELOPER_OPTIONS,
gettext_noop("Disabled reading from system indexes."),
gettext_noop("It does not prevent updating the indexes, so it is safe "
"to use. The worst consequence is slowness."),
GUC_NOT_IN_SAMPLE
},
&IgnoreSystemIndexes,
false, NULL, NULL
},
/* End-of-list marker */ /* End-of-list marker */
{ {
{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL {NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL
@ -987,6 +1010,15 @@ static struct config_bool ConfigureNamesBool[] =
static struct config_int ConfigureNamesInt[] = static struct config_int ConfigureNamesInt[] =
{ {
{
{"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS,
gettext_noop("Waits N seconds on connection startup after authentication."),
gettext_noop("This allows attaching a debugger to the process."),
GUC_NOT_IN_SAMPLE
},
&PostAuthDelay,
0, 0, INT_MAX, NULL, NULL
},
{ {
{"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER, {"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER,
gettext_noop("Sets the default statistics target."), gettext_noop("Sets the default statistics target."),
@ -5865,6 +5897,18 @@ assign_custom_variable_classes(const char *newval, bool doit, GucSource source)
return newval; return newval;
} }
static bool
assign_debug_assertions(bool newval, bool doit, GucSource source)
{
#ifndef USE_ASSERT_CHECKING
if (newval)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("assertion checking is not supported by this build")));
#endif
return true;
}
static bool static bool
assign_ssl(bool newval, bool doit, GucSource source) assign_ssl(bool newval, bool doit, GucSource source)
{ {

View File

@ -42,7 +42,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD. * Portions taken from FreeBSD.
* *
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.105 2006/01/05 03:01:36 momjian Exp $ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.106 2006/01/05 10:07:46 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1686,10 +1686,10 @@ setup_sysviews(void)
sysviews_setup = readfile(system_views_file); sysviews_setup = readfile(system_views_file);
/* /*
* We use -N here to avoid backslashing stuff in system_views.sql * We use -j here to avoid backslashing stuff in system_views.sql
*/ */
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"\"%s\" %s -N template1 >%s", "\"%s\" %s -j template1 >%s",
backend_exec, backend_options, backend_exec, backend_options,
DEVNULL); DEVNULL);
@ -1870,10 +1870,10 @@ setup_schema(void)
lines = readfile(info_schema_file); lines = readfile(info_schema_file);
/* /*
* We use -N here to avoid backslashing stuff in information_schema.sql * We use -j here to avoid backslashing stuff in information_schema.sql
*/ */
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"\"%s\" %s -N template1 >%s", "\"%s\" %s -j template1 >%s",
backend_exec, backend_options, backend_exec, backend_options,
DEVNULL); DEVNULL);

View File

@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.184 2005/11/22 18:17:29 momjian Exp $ * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.185 2006/01/05 10:07:46 petere Exp $
* *
* NOTES * NOTES
* some of the information in this file should be moved to other files. * some of the information in this file should be moved to other files.
@ -306,8 +306,7 @@ extern bool InitPostgres(const char *dbname, const char *username);
extern void BaseInit(void); extern void BaseInit(void);
/* in utils/init/miscinit.c */ /* in utils/init/miscinit.c */
extern void IgnoreSystemIndexes(bool mode); extern bool IgnoreSystemIndexes;
extern bool IsIgnoringSystemIndexes(void);
extern void SetReindexProcessing(Oid heapOid, Oid indexOid); extern void SetReindexProcessing(Oid heapOid, Oid indexOid);
extern void ResetReindexProcessing(void); extern void ResetReindexProcessing(void);
extern bool ReindexIsProcessingHeap(Oid heapOid); extern bool ReindexIsProcessingHeap(Oid heapOid);

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.78 2005/10/15 02:49:46 momjian Exp $ * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.79 2006/01/05 10:07:46 petere Exp $
* *
* OLD COMMENTS * OLD COMMENTS
* This file was created so that other c files could get the two * This file was created so that other c files could get the two
@ -28,6 +28,7 @@
extern CommandDest whereToSendOutput; extern CommandDest whereToSendOutput;
extern DLLIMPORT const char *debug_query_string; extern DLLIMPORT const char *debug_query_string;
extern int max_stack_depth; extern int max_stack_depth;
extern int PostAuthDelay;
/* GUC-configurable parameters */ /* GUC-configurable parameters */
@ -67,5 +68,8 @@ extern void ResetUsage(void);
extern void ShowUsage(const char *title); extern void ShowUsage(const char *title);
extern void set_debug_options(int debug_flag, extern void set_debug_options(int debug_flag,
GucContext context, GucSource source); GucContext context, GucSource source);
extern bool set_plan_disabling_options(const char *arg,
GucContext context, GucSource source);
extern const char *get_stats_option_name(const char *arg);
#endif /* TCOPPROT_H */ #endif /* TCOPPROT_H */