III. Server Administration

This part covers topics that are of interest to a PostgreSQL database administrator. This includes installation of the software, set up and configuration of the server, management of users and databases, and maintenance tasks. Anyone who runs a PostgreSQL server, even for personal use, but especially in production, should be familiar with the topics covered in this part.

The information in this part is arranged approximately in the order in which a new user should read it. But the chapters are self-contained and can be read individually as desired. The information in this part is presented in a narrative fashion in topical units. Readers looking for a complete description of a particular command should see Part VI.

The first few chapters are written so they can be understood without prerequisite knowledge, so new users who need to set up their own server can begin their exploration with this part. The rest of this part is about tuning and management; that material assumes that the reader is familiar with the general use of the PostgreSQL database system. Readers are encouraged to look at Part I and Part II for additional information.

Table of Contents
16. Installation from Source Code
16.1. Short Version
16.2. Requirements
16.3. Getting The Source
16.4. Installation Procedure
16.5. Post-Installation Setup
16.6. Supported Platforms
16.7. Platform-specific Notes
17. Installation from Source Code on Windows
17.1. Building with Visual C++ or the Microsoft Windows SDK
17.2. Building libpq with Visual C++ or Borland C++
18. Server Setup and Operation
18.1. The PostgreSQL User Account
18.2. Creating a Database Cluster
18.3. Starting the Database Server
18.4. Managing Kernel Resources
18.5. Shutting Down the Server
18.6. Upgrading a PostgreSQL Cluster
18.7. Preventing Server Spoofing
18.8. Encryption Options
18.9. Secure TCP/IP Connections with SSL
18.10. Secure TCP/IP Connections with SSH Tunnels
18.11. Registering Event Log on Windows
19. Server Configuration
19.1. Setting Parameters
19.2. File Locations
19.3. Connections and Authentication
19.4. Resource Consumption
19.5. Write Ahead Log
19.6. Replication
19.7. Query Planning
19.8. Error Reporting and Logging
19.9. Run-time Statistics
19.10. Automatic Vacuuming
19.11. Client Connection Defaults
19.12. Lock Management
19.13. Version and Platform Compatibility
19.14. Error Handling
19.15. Preset Options
19.16. Customized Options
19.17. Developer Options
19.18. Short Options
20. Client Authentication
20.1. The pg_hba.conf File
20.2. User Name Maps
20.3. Authentication Methods
20.4. Authentication Problems
21. Database Roles
21.1. Database Roles
21.2. Role Attributes
21.3. Role Membership
21.4. Dropping Roles
21.5. Default Roles
21.6. Function Security
22. Managing Databases
22.1. Overview
22.2. Creating a Database
22.3. Template Databases
22.4. Database Configuration
22.5. Destroying a Database
22.6. Tablespaces
23. Localization
23.1. Locale Support
23.2. Collation Support
23.3. Character Set Support
24. Routine Database Maintenance Tasks
24.1. Routine Vacuuming
24.2. Routine Reindexing
24.3. Log File Maintenance
25. Backup and Restore
25.1. SQL Dump
25.2. File System Level Backup
25.3. Continuous Archiving and Point-in-Time Recovery (PITR)
26. High Availability, Load Balancing, and Replication
26.1. Comparison of Different Solutions
26.2. Log-Shipping Standby Servers
26.3. Failover
26.4. Alternative Method for Log Shipping
26.5. Hot Standby
27. Recovery Configuration
27.1. Archive Recovery Settings
27.2. Recovery Target Settings
27.3. Standby Server Settings
28. Monitoring Database Activity
28.1. Standard Unix Tools
28.2. The Statistics Collector
28.3. Viewing Locks
28.4. Progress Reporting
28.5. Dynamic Tracing
29. Monitoring Disk Usage
29.1. Determining Disk Usage
29.2. Disk Full Failure
30. Reliability and the Write-Ahead Log
30.1. Reliability
30.2. Write-Ahead Logging (WAL)
30.3. Asynchronous Commit
30.4. WAL Configuration
30.5. WAL Internals
31. Regression Tests
31.1. Running the Tests
31.2. Test Evaluation
31.3. Variant Comparison Files
31.4. TAP Tests
31.5. Test Coverage Examination