Postgresql 7.3.2 Administrator's Guide
Total Page:16
File Type:pdf, Size:1020Kb
PostgreSQL 7.3.2 Administrator’s Guide The PostgreSQL Global Development Group PostgreSQL 7.3.2 Administrator’s Guide by The PostgreSQL Global Development Group Copyright © 1996-2002 by The PostgreSQL Global Development Group Legal Notice PostgreSQL is Copyright © 1996-2002 by the PostgreSQL Global Development Group and is distributed under the terms of the license of the University of California below. Postgres95 is Copyright © 1994-5 by the Regents of the University of California. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCI- DENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IM- PLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HERE- UNDER IS ON AN “AS-IS” BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Table of Contents Preface .........................................................................................................................................................i 1. What is PostgreSQL? ......................................................................................................................i 2. A Short History of PostgreSQL ......................................................................................................i 2.1. The Berkeley POSTGRES Project ................................................................................... ii 2.2. Postgres95......................................................................................................................... ii 2.3. PostgreSQL...................................................................................................................... iii 3. What’s In This Book .....................................................................................................................iv 4. Overview of Documentation Resources........................................................................................iv 5. Terminology and Notation .............................................................................................................v 6. Bug Reporting Guidelines.............................................................................................................vi 6.1. Identifying Bugs ...............................................................................................................vi 6.2. What to report................................................................................................................. vii 6.3. Where to report bugs ..................................................................................................... viii 1. Installation Instructions ........................................................................................................................1 1.1. Short Version...............................................................................................................................1 1.2. Requirements ..............................................................................................................................1 1.3. Getting The Source .....................................................................................................................3 1.4. If You Are Upgrading .................................................................................................................4 1.5. Installation Procedure .................................................................................................................5 1.6. Post-Installation Setup ..............................................................................................................10 1.6.1. Shared Libraries............................................................................................................11 1.6.2. Environment Variables .................................................................................................11 1.7. Supported Platforms..................................................................................................................12 2. Installation on Windows......................................................................................................................18 3. Server Run-time Environment ...........................................................................................................19 3.1. The PostgreSQL User Account.................................................................................................19 3.2. Creating a Database Cluster......................................................................................................19 3.3. Starting the Database Server .....................................................................................................20 3.3.1. Server Start-up Failures................................................................................................21 3.3.2. Client Connection Problems.........................................................................................22 3.4. Run-time Configuration ............................................................................................................23 3.4.1. pg_settings....................................................................................................................24 3.4.2. Planner and Optimizer Tuning......................................................................................24 3.4.3. Logging and Debugging ...............................................................................................26 3.4.4. General Operation ........................................................................................................29 3.4.5. WAL .............................................................................................................................36 3.4.6. Short Options................................................................................................................37 3.5. Managing Kernel Resources .....................................................................................................38 3.5.1. Shared Memory and Semaphores.................................................................................38 3.5.2. Resource Limits............................................................................................................42 3.6. Shutting Down the Server .........................................................................................................43 3.7. Secure TCP/IP Connections with SSL......................................................................................44 3.8. Secure TCP/IP Connections with SSH Tunnels........................................................................45 iii 4. Database Users and Privileges............................................................................................................47 4.1. Database Users..........................................................................................................................47 4.2. User Attributes ..........................................................................................................................47 4.3. Groups.......................................................................................................................................48 4.4. Privileges...................................................................................................................................48 4.5. Functions and Triggers..............................................................................................................49 5. Managing Databases............................................................................................................................50 5.1. Overview ...................................................................................................................................50 5.2. Creating a Database ..................................................................................................................50 5.3. Template Databases...................................................................................................................51 5.4. Database Configuration.............................................................................................................52 5.5. Alternative Locations ................................................................................................................53 5.6. Destroying a Database...............................................................................................................54 6. Client Authentication...........................................................................................................................55 6.1. The pg_hba.conf file..............................................................................................................55 6.2. Authentication methods ............................................................................................................59