This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com • • Table of Contents Index PostgreSQL By Korry Douglas, Susan Douglas Publisher: Sams Publishing Pub Date: February 13, 2003 ISBN: 0-7357-1257-3 Pages: 816 Slots: The definitive guide to working with the powerful PostgreSQL open source database system PostgreSQL leads the reader through the internals of the powerful PostgreSQL open source database Throughout the book, readers will find explanations of data structures and algorithms, each backed by a concrete example from the actual source code Each section contains information about performance implications, debugging techniques, and pointers to more information (on Web and in book form) The reader will find an easy to read, code-based approach that makes it easy to understand how each feature is implemented, how to best use each feature, and how to squeeze more performance from database applications Previously announced in 2/03 catalog Korry Douglas is the Director of Research and Development for Appx Software Over the last two decades, he has worked on the design and implementation of a number of high-level languages and development environments His products interface with many relational (and non-relational) databases Working with many different database products (Oracle, Sybase, SQL Server, PostgreSQL, MySQL, and MSQL) has given him a unique understanding of the commonalties of, and differences between databases This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com • • Table of Contents Index PostgreSQL By Korry Douglas, Susan Douglas Publisher: Sams Publishing Pub Date: February 13, 2003 ISBN: 0-7357-1257-3 Pages: 816 Slots: Copyright About the Authors About the Technical Reviewers About the Development Editor Acknowledgments We Want to Hear from You Reader Services Preface Introduction PostgreSQL Features What Versions Does This Book Cover? What Topics Does This Book Cover? Part I: General PostgreSQL Use Chapter Introduction to PostgreSQL and SQL A Sample Database Basic Database Terminology Prerequisites Connecting to a Database Creating Tables Viewing Table Descriptions Adding New Records to a Table Installing the Sample Database Retrieving Data from the Sample Database Aggregates Multi-Table Joins UPDATE DELETE A (Very) Short Introduction to Transaction Processing Creating New Tables Using CREATE TABLE AS Using VIEW Summary Chapter Working with Data in PostgreSQL NULL Values This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com NULL Values Character Values Numeric Values Date/Time Values Boolean (Logical) Values Geometric Data Types Object IDs (OID) BLOBs Network Address Data Types Sequences Arrays Column Constraints Expression Evaluation and Type Conversion Creating Your Own Data Types Summary Chapter PostgreSQL SQL Syntax and Use PostgreSQL Naming Rules Creating, Destroying, and Viewing Databases Creating New Tables Adding Indexes to a Table Getting Information About Databases and Tables Transaction Processing Summary Chapter Performance How PostgreSQL Organizes Data Gathering Performance Information Understanding How PostgreSQL Executes a Query Table Statistics Performance Tips Part II: Programming with PostgreSQL Chapter Introduction to PostgreSQL Programming Server-Side Programming Client-Side APIs General Structure of Client Applications Choosing an Application Environment Summary Chapter Extending PostgreSQL Extending the PostgreSQL Server with Custom Functions Returning Multiple Values from an Extension Function Extending the PostgreSQL Server with Custom Data Types Internal and External Forms Defining a Simple Data Type in PostgreSQL Defining the Data Type in C Defining the Input and Output Functions in C Defining the Input and Output Functions in PostgreSQL Defining the Data Type in PostgreSQL Summary Chapter PL/pgSQL Installing PL/pgSQL Language Structure Function Body Cursors Triggers This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Triggers Summary Chapter The PostgreSQL C API—libpq Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Simple Processing—PQexec() and PQprint() Client 4—An Interactive Query Processor Summary Chapter A Simpler C API—libpgeasy Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Chapter 10 The PostgreSQL C++ API—libpq++ Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Chapter 11 Embedding SQL Commands in C Programs—ecpg Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing SQL Commands Client 4—An Interactive Query Processor Summary Chapter 12 Using PostgreSQL from an ODBC Client Application ODBC Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Resources Chapter 13 Using PostgreSQL from a Java Client Application JDBC Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Chapter 14 Using PostgreSQL with Perl DBI Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Client 4—An Interactive Query Processor Summary Chapter 15 Using PostgreSQL with PHP PHP Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Query Processing Client 4—an Interactive Query Processor Other Features Summary Chapter 16 Using PostgreSQL with Tcl and Tcl/Tk Prerequisites Client 1—Connecting to the Server Client 2—Query Processing Client 3—An Interactive Query Processor The libpgtcl Large-Object API Summary Chapter 17 Using PostgreSQL with Python Python/PostgreSQL Interface Architecture Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Query Processing Client 4—An Interactive Command Processor Summary Part III: PostgreSQL Administration Chapter 18 Introduction to PostgreSQL Administration Security User Accounts Backup and Restore Server Startup and Shutdown Tuning Installing Updates Localization Summary Chapter 19 PostgreSQL Administration Roadmap (Where's All My Stuff?) Installing PostgreSQL Managing Databases Managing User Accounts Configuring Your PostgreSQL Runtime Environment Arranging for PostgreSQL Startup and Shutdown Backing Up and Copying Databases Summary Chapter 20 Internationalization and Localization Locale Support Multibyte Character Sets Summary Chapter 21 Security Securing the PostgreSQL Data Files Securing Network Access This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Securing Tables Summary Index This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Copyright Copyright © 2003 by Sams Publishing FIRST EDITION: February 2003 All rights reserved No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without written permission from the publisher, except for the inclusion of brief quotations in a review Library of Congress Catalog Card Number: 2001098750 06 05 04 03 Interpretation of the printing code: The rightmost double-digit number is the year of the book's printing; the rightmost single-digit number is the number of the book's printing For example, the printing code 03-1 shows that the first printing of the book occurred in 2003 Printed in the United States of America Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized Sams Publishing cannot attest to the accuracy of this information Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark Warning and Disclaimer This book is designed to provide information about PostgreSQL Every effort has been made to make this book as complete and as accurate as possible, but no warranty of fitness is implied The information is provided on an as-is basis The authors and Sams Publishing shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the discs or programs that may accompany it Credits Acquisitions Editors Stephanie Wall Elise Walter Development Editors Chris Zahn Paul DuBois Managing Editor Charlotte Clapp Senior Project Editor Lori Lyons Copy Editor Linda Seifert Senior Indexer Cheryl Lenser Proofreader Nancy Sixsmith This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Composition Stacey DeRome Cover Designer Alan Clements This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com About the Authors Korry Douglas is the Director of Research and Development for Appx Software Over the last two decades, he has worked on the design and implementation of a number of high-level, high-productivity languages and development environments His products interface with many relational (and non-relational) databases Working with so many different database products (Oracle, Sybase, SQL Server, DB2, PostgreSQL, MySQL, MSQL) has given him a broad understanding of the commonalities of, and differences between, databases Susan Douglas is the President and CEO of Conjectrix, Inc., a software company specializing in database technologies and security tools Consulting to the end-user community has given her widespread database experience and a real appreciation for high-quality programs and flexible tools powerful enough to handle data well and intuitive enough to actually use Korry and his wife (and best friend) Susan raise horses in rural Virginia Both are natives of the Pacific Northwest, but prefer the sunshine and open spaces offered by Virginia They both telecommute, preferring to spend as much time as possible with their 200 or so animal friends (who never complain about buggy code, inelegant design, or poor performance) Susan is an avid equestrienne; Korry gets to clean the barn This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com About the Technical Reviewers These reviewers contributed their considerable hands-on expertise to the entire development process for PostgreSQL As the book was being written, these dedicated professionals reviewed all the material for technical content, organization, and flow Their feedback was critical to ensuring that PostgreSQL fits our reader's need for the highestquality technical information Barry Stinson graduated from Louisiana State University in 1995 with a Master's Degree in Music Composition During his tenure there, he was fortunate enough to help design the Digital Arts studio with Dr Stephen David Beck Designing a full-fledged music and graphic-arts digital studio afforded him exposure to a diverse set of unique computing systems —particularly those from NeXT, SGI, and Apple It was during this time that he discovered Linux, and subsequently PostgreSQL, both of which were still in an early stage of development After graduation, Barry set up his own consulting company, Silicon Consulting, which is based in Lafayette, LA Over the years, he has worked as a consultant for many companies throughout southern Louisiana Increasingly, much of the work that Barry has done over the years has centered on databases In the time from his original exposure to Postgre95—to its present form as PostgreSQL—an amazing amount of development has taken place on open-source database systems The rise of high-quality and open-sourced computing systems that have taken place recently has produced a renaissance in the high-tech industry However, according to his girlfriend Pamela, his continued insistence to rely on renegade operating systems, such as Linux, has only served to strengthen the unruly aspects already present in his personality Barry is the author of New Riders PostgreSQL Essential Reference Peter Eisentraut, from Dresden, Germany, became involved with PostgreSQL development in 1999 when he needed to scratch the proverbial itch (The result is the tab-completion in the psql client.) He has since worked in many areas of the PostgreSQL code, reviewed several PostgreSQL books, and contributed to other open-source projects In his spare time he likes to study human languages and plans to ride his bicycle to the places where those languages are spoken This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Part II: Programming with PostgreSQL Introduction to PostgreSQL Programming Extending PostgreSQL PL/pgSQL The PostgreSQL C API—libpq A Simpler C API—libpgeasy 10 The PostgreSQL C++ API—libpq++ 11 Embedding SQL Commands in C Programs—ecpg 12 Using PostgreSQL from an ODBC Client Application 13 Using PostgreSQL from a Java Client Application 14 Using PostgreSQL with Perl 15 Using PostgreSQL with PHP 16 Using PostgreSQL with Tcl and Tcl/Tk 17 Using PostgreSQL with Python This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Part III: PostgreSQL Administration 18 Introduction to PostgreSQL Administration 19 PostgreSQL Administration 20 Internationalization and Localization 21 Security This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com About the Authors Korry Douglas is the Director of Research and Development for Appx Software Over the last two decades, he has worked on the design and implementation of a number of high-level, high-productivity languages and development environments His products interface with many relational (and non-relational) databases Working with so many different database products (Oracle, Sybase, SQL Server, DB2, PostgreSQL, MySQL, MSQL) has given him a broad understanding of the commonalities of, and differences between, databases Susan Douglas is the President and CEO of Conjectrix, Inc., a software company specializing in database technologies and security tools Consulting to the end-user community has given her widespread database experience and a real appreciation for high-quality programs and flexible tools powerful enough to handle data well and intuitive enough to actually use Korry and his wife (and best friend) Susan raise horses in rural Virginia Both are natives of the Pacific Northwest, but prefer the sunshine and open spaces offered by Virginia They both telecommute, preferring to spend as much time as possible with their 200 or so animal friends (who never complain about buggy code, inelegant design, or poor performance) Susan is an avid equestrienne; Korry gets to clean the barn This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com About the Technical Reviewers These reviewers contributed their considerable hands-on expertise to the entire development process for PostgreSQL As the book was being written, these dedicated professionals reviewed all the material for technical content, organization, and flow Their feedback was critical to ensuring that PostgreSQL fits our reader's need for the highestquality technical information Barry Stinson graduated from Louisiana State University in 1995 with a Master's Degree in Music Composition During his tenure there, he was fortunate enough to help design the Digital Arts studio with Dr Stephen David Beck Designing a full-fledged music and graphic-arts digital studio afforded him exposure to a diverse set of unique computing systems —particularly those from NeXT, SGI, and Apple It was during this time that he discovered Linux, and subsequently PostgreSQL, both of which were still in an early stage of development After graduation, Barry set up his own consulting company, Silicon Consulting, which is based in Lafayette, LA Over the years, he has worked as a consultant for many companies throughout southern Louisiana Increasingly, much of the work that Barry has done over the years has centered on databases In the time from his original exposure to Postgre95—to its present form as PostgreSQL—an amazing amount of development has taken place on open-source database systems The rise of high-quality and open-sourced computing systems that have taken place recently has produced a renaissance in the high-tech industry However, according to his girlfriend Pamela, his continued insistence to rely on renegade operating systems, such as Linux, has only served to strengthen the unruly aspects already present in his personality Barry is the author of New Riders PostgreSQL Essential Reference Peter Eisentraut, from Dresden, Germany, became involved with PostgreSQL development in 1999 when he needed to scratch the proverbial itch (The result is the tab-completion in the psql client.) He has since worked in many areas of the PostgreSQL code, reviewed several PostgreSQL books, and contributed to other open-source projects In his spare time he likes to study human languages and plans to ride his bicycle to the places where those languages are spoken This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com About the Development Editor This reviewer brought his gift for writing clear, understandable technical prose to this book in his role as Development Editor Paul DuBois is a writer, database administrator, and leader in the open-source community He is the author of the best-selling MySQL, and MySQL and Perl for the Web, for New Riders Publishing, and MySQL Cookbook, Using csh and tcsh, and Software Portability with imake for O'Reilly and Associates This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Acknowledgments Thank you to our technical reviewers, Peter Eisentraut and Barry Stinson, and to Paul DuBois for his developmental reviewing We appreciate their many hours spent poring through manuscripts exposing technical inaccuracies and poor grammar Their knowledge and expertise have been invaluable Thank you to the staff at New Riders, especially Chris Zahn, Elise Walter, and Stephanie Wall for keeping this project manageable, on time, and on course The help and support they have provided has made this book possible We would especially like to thank the developers of PostgreSQL for the years of development spent producing an excellent database Without their devotion to the project, it wouldn't have evolved into the masterpiece we all know today Most of the books that we read are dedicated to various household members for the long hours devoted to their writing project rather than to family life Instead, we have enjoyed the long hours of R&D spent together, interspersed with screaming (during breaks, on the Roller Coasters at King's Dominion—not at each other) This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com We Want to Hear from You As the reader of this book, you are our most important critic and commentator We value your opinion and want to know what we're doing right, what we could better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way You can email or write me directly to let me know what you did or didn't like about this book—as well as what we can to make our books stronger Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message When you write, please be sure to include this book's title and author, as well as your name and contact information I will carefully review your comments and share them with the author and editors who worked on the book Email: opensource@samspublishing.com Mail: Mark Taber Associate Publisher Sams Publishing 201 West 103rd Street Indianapolis, IN 46290 USA This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Reader Services For more information about this book or others from Sams Publishing, visit our Web site at www.samspublishing.com Type the ISBN (excluding hyphens) or the title of the book in the Search box to find the book you're looking for This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Preface These days, it seems that most discussion of open-source software centers on the idea that you should not have to tie your future to the whim of some giant corporation People say that open-source software is better than proprietary software because it is developed and maintained by the users instead of a faceless company out to lighten your wallet I think that the real value in free software is education I have never learned anything by reading my own code[1] On the other hand, it's a rare occasion when I've looked at code written by someone else and haven't come away with another tool in my toolkit People don't think alike I don't mean that people disagree with each other; I mean that people solve problems in different ways Each person brings a unique set of experiences to the table Each person has his own set of goals and biases Each person has his own interests All these things will shape the way you think about a problem Often, I'll find myself in a heated disagreement with a colleague only to realize that we are each correct in our approach Just because I'm right, doesn't mean that my colleague can't be right as well [1] Maybe I should say that I have never learned anything new by reading my own code I've certainly looked at code that I've written and wondered what I was thinking at the time, learning that I'm not nearly as clever as I had remembered Oddly enough, those who have read my code have reached a similar conclusion Open-source software is a great way to learn You can learn about programming You can learn about design You can learn about debugging Sometimes, you'll learn how not to design, code, or debug; but that's a valuable lesson too You can learn small things, such as how to cache file descriptors on systems where file descriptors are a scarce and expensive resource, or how to use the select() function to implement fine-grained timers You can learn big things, like how a query optimizer works or how to write a parser, or how to develop a good memory management strategy PostgreSQL is a great example I've been using databases for the last two decades I've used most of the major commercial databases: Oracle, Sybase, DB2, and MS SQL Server With each commercial database, there is a wall of knowledge between my needs and the vendor's need to protect his intellectual property Until I started exploring opensource databases, I had an incomplete understanding of how a database works Why was this particular feature implemented that way? Why am I getting poor performance when I try this? That's a neat feature; I wonder how they did that? Every commercial database tries to expose a small piece of its inner workings The explain statement will show you why the database makes its optimization decisions But, you only get to see what the vendor wants you to see The vendor isn't trying to hide things from you (in most cases), but without complete access to the source code, they have to pick and choose how to expose information in a meaningful way With open source software, you can dive deep into the source code and pull out all the information you need While writing this book, I've spent a lot of time reading through the PostgreSQL source code I've added a lot of my own code to reveal more information so that I could explain things more clearly I can't that with a commercial database There are gems of brilliance in most open-source projects In a well-designed, well-factored project, you will find designs and code that you can use in your own projects Many open source projects are starting to split their code into reusable libraries The Apache Portable Runtime is a good example The Apache Web server runs on many diverse platforms The Apache development team saw the need for a layer of abstraction that would provide a portable interface to system functions such as shared memory and network access They decided to factor the portability layer into a library separate from their main project The result is the Apache Portable Runtime - a library of code that can be used in other open-source projects (such as PostgreSQL) Some developers hate to work on someone else's code I love working on code written by another developer–—I always learn something from the experience I strongly encourage you to dive into the PostgreSQL source code You will learn from it You might even decide to contribute to the project This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Introduction PostgreSQL is a relational database with a long history In the late 1970s, the University of California at Berkeley began development of PostgreSQL's ancestor—a relational database known as Ingres Relational Technologies turned Ingres into a commercial product Relational Technologies became Ingres Corporation and was later acquired by Computer Associates Around 1986, Michael Stonebraker from UC Berkeley led a team that added object-oriented features to the core of Ingres; the new version became known as Postgres Postgres was again commercialized; this time by a company named Illustra, which became part of the Informix Corporation Andrew Yu and Jolly Chen added SQL support to Postgres in the mid-90s Prior versions had used a different, Postgres-specific query language known as Postquel In 1996, many new features were added, including the MVCC transaction model, more adherence to the SQL92 standard, and many performance improvements Postgres once again took on a new name: PostgreSQL Today, PostgreSQL is developed by an international group of open-source software proponents known as the PostgreSQL Global Development group PostgreSQL is an open-source product—it is not proprietary in any way Red Hat has recently commercialized PostgreSQL, creating the Red Hat Database, but PostgreSQL itself will remain free and open-source This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com • • Table of Contents Index PostgreSQL By Korry Douglas, Susan Douglas Publisher: Sams Publishing Pub Date: February 13, 2003 ISBN: 0-7357-1257-3 Pages: 816 Slots: Copyright About the Authors About the Technical Reviewers About the Development Editor Acknowledgments We Want to Hear from You Reader Services Preface Introduction PostgreSQL Features What Versions Does This Book Cover? What Topics Does This Book Cover? Part I: General PostgreSQL Use Chapter Introduction to PostgreSQL and SQL A Sample Database Basic Database Terminology Prerequisites Connecting to a Database Creating Tables Viewing Table Descriptions Adding New Records to a Table Installing the Sample Database Retrieving Data from the Sample Database Aggregates Multi-Table Joins UPDATE DELETE A (Very) Short Introduction to Transaction Processing Creating New Tables Using CREATE TABLE AS Using VIEW Summary Chapter Working with Data in PostgreSQL NULL Values This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com NULL Values Character Values Numeric Values Date/Time Values Boolean (Logical) Values Geometric Data Types Object IDs (OID) BLOBs Network Address Data Types Sequences Arrays Column Constraints Expression Evaluation and Type Conversion Creating Your Own Data Types Summary Chapter PostgreSQL SQL Syntax and Use PostgreSQL Naming Rules Creating, Destroying, and Viewing Databases Creating New Tables Adding Indexes to a Table Getting Information About Databases and Tables Transaction Processing Summary Chapter Performance How PostgreSQL Organizes Data Gathering Performance Information Understanding How PostgreSQL Executes a Query Table Statistics Performance Tips Part II: Programming with PostgreSQL Chapter Introduction to PostgreSQL Programming Server-Side Programming Client-Side APIs General Structure of Client Applications Choosing an Application Environment Summary Chapter Extending PostgreSQL Extending the PostgreSQL Server with Custom Functions Returning Multiple Values from an Extension Function Extending the PostgreSQL Server with Custom Data Types Internal and External Forms Defining a Simple Data Type in PostgreSQL Defining the Data Type in C Defining the Input and Output Functions in C Defining the Input and Output Functions in PostgreSQL Defining the Data Type in PostgreSQL Summary Chapter PL/pgSQL Installing PL/pgSQL Language Structure Function Body Cursors Triggers This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Triggers Summary Chapter The PostgreSQL C API—libpq Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Simple Processing—PQexec() and PQprint() Client 4—An Interactive Query Processor Summary Chapter A Simpler C API—libpgeasy Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Chapter 10 The PostgreSQL C++ API—libpq++ Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Chapter 11 Embedding SQL Commands in C Programs—ecpg Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing SQL Commands Client 4—An Interactive Query Processor Summary Chapter 12 Using PostgreSQL from an ODBC Client Application ODBC Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Resources Chapter 13 Using PostgreSQL from a Java Client Application JDBC Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries Client 4—An Interactive Query Processor Summary Chapter 14 Using PostgreSQL with Perl DBI Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Processing Queries This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Client 4—An Interactive Query Processor Summary Chapter 15 Using PostgreSQL with PHP PHP Architecture Overview Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Query Processing Client 4—an Interactive Query Processor Other Features Summary Chapter 16 Using PostgreSQL with Tcl and Tcl/Tk Prerequisites Client 1—Connecting to the Server Client 2—Query Processing Client 3—An Interactive Query Processor The libpgtcl Large-Object API Summary Chapter 17 Using PostgreSQL with Python Python/PostgreSQL Interface Architecture Prerequisites Client 1—Connecting to the Server Client 2—Adding Error Checking Client 3—Query Processing Client 4—An Interactive Command Processor Summary Part III: PostgreSQL Administration Chapter 18 Introduction to PostgreSQL Administration Security User Accounts Backup and Restore Server Startup and Shutdown Tuning Installing Updates Localization Summary Chapter 19 PostgreSQL Administration Roadmap (Where's All My Stuff?) Installing PostgreSQL Managing Databases Managing User Accounts Configuring Your PostgreSQL Runtime Environment Arranging for PostgreSQL Startup and Shutdown Backing Up and Copying Databases Summary Chapter 20 Internationalization and Localization Locale Support Multibyte Character Sets Summary Chapter 21 Security Securing the PostgreSQL Data Files Securing Network Access This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Securing Tables Summary Index ... applications postgresql-odbc ODBC driver for PostgreSQL postgresql-jdbc JDBC driver for PostgreSQL postgresql-tk Tk client and pgaccess postgresql-tcl Tcl client and PL/Tcl postgresql-perl Perl... library and PL/Perl postgresql-python PygreSQL library postgresql-test Regression test suite for PostgreSQL postgresql-libs Shared libraries for client applications postgresql-docs Extra documentation... with PostgreSQL by downloading the postgresql, postgresql-libs, and postgresql-server packages The actual files (at the www.postgresql.org web site) have names that include a version number: postgresql-libs-7.1.31PGDG.i386.rpm,