Top
Enterprise Postgres 17 SP1 Operation Guide

2.1.2 Using Server Commands

Server commands enable you to start or stop an instance and check its operating status.

To use sever commands, configure the environment variables.

See

Refer to " Configure the environment variables" in the procedure to create instances in " Using the initdb Command" in the Installation and Setup Guide for Server for information on configuring the environment variables.

Starting an instance

Use the pg_ctl command to start an instance.

Specify the following values in the pg_ctl command:

Example

> pg_ctl start -D /database/inst1

The message FATAL:the database system is starting up(11189)" may be output in the following cases. This is output by the pg_ctl command to see if the instance's processes have finished starting. Therefore, if there are no other applications, commands, or processes connecting to the database, ignore this message.

If the -W option is specified, the command will return without waiting for the instance to finish starting. Therefore, you need to check the server log to see if the instance has started successfully.

Stopping an instance

Use the pg_ctl command to stop an instance.

Specify the following values in the pg_ctl command:

Example

> pg_ctl stop -D /database/inst1

Checking the operating status of an instance

Use the pg_ctl command to check the operating status of an instance.

Specify the following values in the pg_ctl command:

Example

When the instance is active:

> pg_ctl status -D /database/inst1
pg_ctl: server is running (PID: 1234)

When the instance is inactive:

> pg_ctl status -D /database/inst1
pg_ctl: no server running.

See

Refer to "pg_ctl" under "Reference" in the PostgreSQL Documentation for information on pg_ctl command.