Re: [HACKERS] pg_ctl man page

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: lockhart(at)alumni(dot)caltech(dot)edu
Cc: t-ishii(at)sra(dot)co(dot)jp, peter_e(at)gmx(dot)net, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] pg_ctl man page
Date: 2000-02-22 01:47:57
Message-ID: 20000222104757U.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Beta testing is about to start, but I have not heard from Vadim what
he thinks about "smart" etc yet. Time is up... So I decided to keep
the options of pg_ctl as it is for coming 7.0.

P.S. I have reverted back "-smart" to "-m smart" as Peter and Thomas
suggested. If I have spare time, I would add "---" style options as
well. My first priority is fixing bugs and writing documentaions about
the multibyte support...
--
Tatsuo Ishii
-------------------------------------------------------------------
NAME

pg_ctl - starts/stops/restarts postmaster

SYNOPSIS

pg_ctl [-w][-D database_dir][-p path_to_postmaster][-o "postmaster_opts"] start
pg_ctl [-w][-D database_dir][-m [s[mart]|f[ast]|i[mmediate]]] stop
pg_ctl [-w][-D database_dir][-m [s[mart]|f[ast]|i[mmediate]][-o "postmaster_opts"] restart
pg_ctl [-D database_dir] status

DESCRIPTION

pg_ctl is a utility for starting, stopping or restarting postmaster.

Starting postmaster

To start postmaster:

pg_ctl start

If -w is supplied, pg_ctl waits for the database server comes up, by
watching for creation of the pid file (PGDATA/postmaster.pid), for up
to 60 seconds.

Parameters to invoke postmaster are taken from following sources:

Path to postmaster: found in the command search path
Database directory: PGDATA environment variable
Other parameters: PGDATA/postmaster.opts.default

postmaster.opts.default contains parameters for postmaster. With a
default installation, the "-S" option is enabled. So "pg_ctl start"
implies:

postmaster -S

Note that postmaster.opts.default is installed by initdb from
lib/postmaster.opts.default.sample under the PostgreSQL installation
directory (lib/postmaster.opts.default.sample is copied from
src/bin/pg_ctl/postmaster.opts.default.sample while installing
PostgreSQL).

To override default parameters you can use -D, -p and -o options.

-D database_dir
specifies the database directory

-p path_to_postmaster
specifies the path to postmaster

-o "postmaster_opts"
specifies any parameters for postmaster

Examples:

# blocks until postmaster comes up
pg_ctl -w start

# specifies postmaster path
pg_ctl -p /usr/local/pgsq/bin/postmaster start

# uses port 5433 and disables fsync
pg_ctl -o "-o -F -p 5433" start

Stopping postmaster

pg_ctl stop

stops postmaster.

There are several options for the stopping mode.

-w
waits for postmaster to shut down

-m [s[mart]|f[ast]|i[mmediate]]
specifies the shutdown mode. smart mode waits for all
the clients to logout. This is the default.
fast mode sends SIGTERM to the backends, that means
active transactions get rolled back. immediate mode sends SIGUSR1
to the backends and lets them abort. In this case, database recovery
will be neccessary on the next startup.

Restarting postmaster

This is almost equivalent to stopping postmaster then starting it
again except that the parameters for postmaster used before stopping
it would be used too. This is done by saving them in
PGDATA/postmaster.opts file. -w, -D, -m, -fast, -immediate and -o
can also be used in the restarting mode and they have same meanings as
described above.

Examples:

# restarts postmaster in the simplest form
pg_ctl restart

# restarts postmaster, waiting for it to shut down and to come up
pg_ctl -w restart

# uses port 5433 and disables fsync next time
pg_ctl -o "-o -F -p 5433" restart

Getting status from postmaster

To get status information from postmaster:

pg_ctl status

Following is sample outputs from pg_ctl.

pg_ctl: postmaster is running (pid: 13718)
options are:
/usr/local/src/pgsql/current/bin/postmaster
-p 5433
-D /usr/local/src/pgsql/current/data
-B 64
-b /usr/local/src/pgsql/current/bin/postgres
-N 32
-o '-F'

************

************

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-02-22 03:34:56 Re: [HACKERS] Numeric with '-'
Previous Message Hiroshi Inoue 2000-02-22 01:13:57 RE: [HACKERS] Numeric with '-'