Server Startup and Shutdown

There are a variety of ways to start and stop the PostgreSQL server. In earlier chapters, you used the pg_ctl command to perform server startup and shutdown. pg_ctl is a shell script that controls the postmaster; in some circumstances, you may want to bypass pg_ctl and interact directly with the postmaster. You'll learn how to do that in the next chapter.

In most cases, you will want the postmaster to start when your host system boots. You'll also want the postmaster to shut down gracefully whenever the host is powered down. The method you use to accomplish this varies with the host operating system. In Chapter 19, "General PostgreSQL Administration," you'll learn how to arrange for boot-time startup and graceful shutdown for a few of the more common operating systems.



    Part II: Programming with PostgreSQL