Sams PostgreSQL the comprehensive guide to buildin 001

1.9K 150 0
Sams PostgreSQL the comprehensive guide to buildin 001

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

PostgreSQL: The comprehensive guide to building, programming, and administering PostgreSQL databases, Second Edition By Korry Douglas, Susan Douglas Publisher: Sams Publishing Pub Date: July 26, 2005 ISBN: 0-672-32756-2 Pages: 1032 Table of Contents | Index The second edition of the best-selling PostgreSQL has been updated to completely cover new features and capabilities of the 8.0 version of PostgreSQL You will be lead through the internals of the powerful PostgreSQL open source database chapter, offering an easyto-read, code-based approach that makes it easy to understand how each feature is implemented, how to best use each feature, and how to get more performance from database applications This definitive guide to building, programming and administering the powerful PostgreSQL open-source database system will help you harness one of the most widely used open source, enterprise-level database systems PostgreSQL: The comprehensive guide to building, programming, and administering PostgreSQL databases, Second Edition By Korry Douglas, Susan Douglas Publisher: Sams Publishing Pub Date: July 26, 2005 ISBN: 0-672-32756-2 Pages: 1032 Table of Contents | Index Copyright The Real Value in Free Software About the Authors Acknowledgments We Want to Hear from You! Reader Services Introduction PostgreSQL Features What Versions Does This Book Cover? What Topics Does This Book Cover? What's New in the Second Edition? Part I: General PostgreSQL Use Chapter 1 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 The CASE Expression Aggregates Multi-Table Joins UPDATE DELETE A (Very) Short Introduction to Transaction Processing Creating New Tables Using CREATE TABLE AS Using VIEW Summary Chapter 2 Working with Data in PostgreSQL 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 3 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 4 Performance How PostgreSQL Organizes Data Gathering Performance Information Understanding How PostgreSQL Executes a Query Execution Plans Generated by the Planner The ARC Buffer Manager Table Statistics Performance Tips Part II: Programming with PostgreSQL Chapter 5 Introduction to PostgreSQL Programming Server-Side Programming Client-Side APIs General Structure of Client Applications Choosing an Application Environment Summary Chapter 6 Extending PostgreSQL Extending the PostgreSQL Server with Custom Functions Returning Multiple Values from an Extension Function The PostgreSQL SRF Interface Returning Complete Rows 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 Indexing Custom Data Types Summary Chapter 7 PL/pgSQL Installing PL/pgSQL Language Structure Function Body Cursors Triggers Polymorphic Functions PL/pgSQL and Security Summary Chapter 8 The PostgreSQL C APIlibpq Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Simple ProcessingPQexec() and PQprint() Client 4An Interactive Query Processor Summary Chapter 9 A Simpler C APIlibpgeasy Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Processing Queries Client 4An Interactive Query Processor Summary Chapter 10 The New PostgreSQL C++ APIlibpqxx Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Processing Queries Client 4Working with transactors Summary Chapter 11 Embedding SQL Commands in C Programsecpg Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Processing SQL Commands Client 4An Interactive Query Processor Summary Chapter 12 Using PostgreSQL from an ODBC Client Application ODBC Architecture Overview Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Processing Queries Client 4An Interactive Query Processor Summary Resources Chapter 13 Using PostgreSQL from a Java Client Application JDBC Architecture Overview Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Processing Queries Client 4An Interactive Query Processor Summary Chapter 14 Using PostgreSQL with Perl DBI Architecture Overview Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Processing Queries Client 4An Interactive Query Processor Summary Chapter 15 Using PostgreSQL with PHP PHP Architecture Overview Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Query Processing Client 4An Interactive Query Processor Other Features Summary Chapter 16 Using PostgreSQL with Tcl and Tcl/Tk Prerequisites Client 1Connecting to the Server Client 2Query Processing Client 3An Interactive Query Processor The libpgtcl Large-Object API Summary Chapter 17 Using PostgreSQL with Python Python/PostgreSQL Interface Architecture Prerequisites Client 1Connecting to the Server Client 2Adding Error Checking Client 3Query Processing Client 4An Interactive Command Processor Summary Chapter 18 Npgsql: The NET Data Provider Prerequisites Preparing Visual Studio Understanding the ADO.NET Class Hierarchy Creating an Npgsql-enabled VB Project Client 1Connecting to the Server Client 2An Interactive Query Processor Client 3Updating the Database with a DataSet Client 4A More Robust Query Processor Client 5Using a Typed DataSet Summary Chapter 19 Other Useful Programming Tools PL/JavaWriting Stored Procedures in Java pgcurlWeb-enabling Your PostgreSQL Server pgbashWriting PostgreSQL-enabled Shell Scripts Part III: PostgreSQL Administration Chapter 20 Introduction to PostgreSQL Administration Security User Accounts Backup and Restore Server Startup and Shutdown Running PostgreSQL on a Windows Host Tuning Installing Updates Localization Summary Chapter 21 PostgreSQL Administration Roadmap (Where's All My Stuff?) Installing PostgreSQL Managing Databases The PostgreSQL BGWRITER process Managing User Accounts Configuring Your PostgreSQL Runtime Environment Arranging for PostgreSQL Startup and Shutdown Backing Up and Copying Databases Point-in-time Recovery Summary Endnotes Chapter 22 Internationalization and Localization Locale Support Multi-Byte Character Sets Summary Endnotes Chapter 23 Security Securing the PostgreSQL Data Files Securing Network Access Securing Tables Securing Functions Summary Chapter 24 Replicating PostgreSQL Data with Slony Overview Requirements Creating a Replication Cluster Starting the Replication Daemons Creating a Replication Set Subscribing to a Replication Set Changing the Cluster Topology (Re-mastering and Failover) Summary Chapter 25 Contributed Modules Exchanging PostgreSQL Data with XML Using Full-text Search Index Copyright Copyright © 2006 by Sams Publishing All rights reserved No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher No patent liability is assumed with respect to the use of the information contained herein Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions Nor is any liability assumed for damages resulting from the use of the information contained herein Library of Congress Catalog Card Number: 2004097929 Printed in the United States of America First Printing: July 2005 08 07 06 05 4 3 2 1 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 Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied The information provided is on an "as is" basis The authors and the publisher 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 Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales For more information, please contact U.S Corporate and Government Sales 1-800-382-3419 corpsales@pearsontechgroup.com For sales outside of the U.S., please contact International Sales international@pearsoned.com Credits Acquisitions Editor Shelley Johnston Development Editor Damon Jordan Managing Editor Charlotte Clapp customizing functions 2nd matching patterns (phrases) 2nd 3rd searching multiple columns 2nd TextAsLongVarChar the ts_debug() function throwing exceptions C++ API libpqxx 2nd 3rd 4th 5th Tid Scan operator 2nd time date values 2nd 3rd 4th 5th 6th 7th 8th values 2nd 3rd supported operators 2nd 3rd syntax for literal values 2nd 3rd 4th 5th 6th 7th 8th 9th 10th timer utility 2nd to_tsvector() function tools make utility pgbash shell 2nd 3rd 4th 5th 6th 7th 8th pgcurl packages 2nd 3rd PL/Java accessing databases 2nd 3rd 4th 5th adding install/uninstall commands to jar files 2nd 3rd 4th 5th functions 2nd 3rd 4th 5th 6th installing 2nd 3rd returning multiple results 2nd 3rd 4th 5th 6th 7th 8th 9th 10th trigger functions 2nd 3rd 4th writing stored procedures pqxx-config creating makefiles 2nd 3rd rpmfind utility timer 2nd topologies replication modifying 2nd 3rd tracking metadata transaction< 2nd 3rd 4th 5th transactions isolation 2nd 3rd 4th 5th 6th 7th 8th processing 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th types of transactors C++ API libpqxx 2nd 3rd 4th 5th 6th 7th 8th 9th transferring ownership translation client/servers multibyet character sets 2nd geometic operators trees parse trigger functions PL/Java functions 2nd 3rd 4th TriggerData object triggers AFTER UPDATES/INSERT/DELETE 2nd 3rd 4th PL/pgSQL 2nd 3rd 4th functon arguments return values security 2nd troubleshooting connections databases 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th duplicate value errors execution errors LISTEN/NOTIFY mechanisms 2nd tables OIDs trusts authentication 2nd truth tables 2nd tsearch2 2nd 3rd 4th 5th 6th 7th 8th configuring 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th functions customizing 2nd multiple columns searching 2nd phrases searching 2nd 3rd tuning [See also optimizing] tuples 2nd C++ API libpqxx 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th performance 2nd 3rd two-level indexes [See also indexes] type() function typed DataSet objects applying 2nd 3rd 4th 5th 6th 7th 8th creating 2nd 3rd 4th 5th 6th types composite applying 2nd 3rd 4th 5th conversion 2nd 3rd 4th conversion operators data [See data types] character values ecpg application 2nd 3rd 4th 5th 6th INTERVAL supported operators 2nd 3rd 4th syntax for literal values 2nd 3rd 4th temporal 2nd 3rd 4th 5th 6th 7th 8th descriptor items handle ODBC numeric 2nd 3rd 4th supported operators 2nd 3rd syntax for literal values of exceptions Python of indexes 2nd 3rd of joins 2nd 3rd 4th of statements assignment 2nd conditional execution 2nd 3rd 4th 5th error handling 2nd 3rd 4th 5th EXECUTE 2nd EXIT GET DIAGNOSTICS labels 2nd 3rd loop constructs 2nd 3rd 4th 5th 6th 7th 8th PERFORM 2nd PL/pgSQL RAISE 2nd 3rd RETURN 2nd RETURN NEXT 2nd 3rd SELECT INTO 2nd of transactions Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] UCS transformation formats (UTF) undef column names Unicode applications uninstall files, adding to jar files 2nd 3rd 4th 5th UNIQUE constraints 2nd unique identifiers generating OIDs 2nd 3rd 4th supported operators 2nd syntax for literal values 2nd Unique operator 2nd UniqueIndex units transactions processing 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th Unix data sources (ODBC) 2nd 3rd 4th 5th 6th 7th 8th installing from binaries from source code 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th permissions startup configuring 2nd 3rd 4th unixODBC installing 2nd 3rd 4th 5th 6th 7th unknown values [See NULL values] UnknownAsLongVarChar UnknownSizes unpacking source code Linux/Unix 2nd 3rd 4th UpdatableCursors UPDATE command 2nd 3rd automatic updates installing 2nd updating databases Npgsql applications 2nd 3rd 4th 5th 6th recalls tables URLs DBI 2nd 3rd JDBC 2nd use DBI directive UseDeclareFetch 2nd user accounts managing 2nd executing CREATE USER command 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th Username users accounts 2nd creating impersonating security 2nd UseServerSidePrepare UTF (UCS transformation formats) Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] VACUUM command 2nd values arrays creating indexes on 2nd 3rd Boolean 2nd supported operators syntax for literal values CASE expressions 2nd formatting column results 2nd 3rd 4th 5th 6th 7th 8th 9th LIMIT clauses 2nd 3rd matching patterns 2nd 3rd 4th 5th 6th OFFSET clauses 2nd 3rd ORDER BY clauses 2nd 3rd characters supported operators 2nd 3rd 4th syntax for literal values 2nd 3rd 4th converting data types defining 2nd dates 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th supported operators 2nd 3rd syntax for literal values 2nd 3rd 4th 5th 6th 7th 8th 9th 10th duplicate OIDs duplicate value errors extension functions returning 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th forms 2nd 3rd indicator variables joining metadata cursor objects NOT NULL column constraints 2nd 3rd NULL 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th C API-libpgeasy 2nd 3rd column constraints 2nd 3rd indexes numeric 2nd data types 2nd supported operators 2nd 3rd syntax for literal values option=value resutl sets retreiving 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th return triggers rows ON UPDATE clause SQLState time 2nd 3rd supported operators 2nd 3rd syntax for literal values 2nd 3rd 4th 5th 6th 7th 8th 9th 10th Unique operator 2nd variables C++ API libpqxx 2nd DATESTYLE 2nd 3rd 4th 5th 6th 7th environment 2nd indicator values PL/pgSQL 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th triggers versions multi-versioning 2nd 3rd VIEW command 2nd 3rd 4th viewing columns results 2nd 3rd 4th 5th 6th 7th 8th 9th connection attributes libpq API 2nd 3rd databases 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th DELETE command 2nd indexes performance 2nd 3rd 4th 5th 6th 7th 8th 9th 10th queries libpq API 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th tables 2nd 3rd 4th 5th descriptions 2nd 3rd statistics 2nd 3rd 4th 5th 6th 7th UPDATE command 2nd 3rd views alternative (Oracle-style dictionary views) INFORMATION_SCHEMA pg_stat Visual Studio Npgsql applications creating VB projects 2nd installing Schema Editor Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] warning messages notice processor objects 2nd 3rd 4th 5th 6th Web-enabling servers (pgcurl package) 2nd 3rd WHERE clause 2nd 3rd 4th windowHandle parameter Windows data file security 2nd 3rd data sources (ODBC) 2nd installing from binaries 2nd 3rd 4th from source code running on 2nd wrapping OIDs write-ahead log parameters 2nd 3rd 4th writing stored procedures (PL/Java) Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] XML exchanging data with 2nd 3rd 4th 5th XPath queries 2nd 3rd 4th 5th 6th 7th 8th XSLT converting with 2nd 3rd 4th 5th xml2 functions 2nd 3rd 4th 5th 6th 7th 8th XMLSchema, creating XOR (#) operator XPath queries 2nd 3rd 4th 5th 6th 7th 8th XSLT 2nd 3rd 4th 5th XSLT (Extensible Stylesheet Language Transformations) xslt_process() function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] ZEROCONF service zones time naming ... 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... 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 Korry Douglas About the Authors Korry Douglas is the director of research and development for... 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 Runtimea library of code that

Ngày đăng: 19/04/2019, 15:43

Từ khóa liên quan

Mục lục

  • PostgreSQL: The comprehensive guide to building, programming, and administering PostgreSQL databases, Second Edition

  • Table of Contents

  • Copyright

  • The Real Value in Free Software

  • About the Authors

  • Acknowledgments

  • We Want to Hear from You!

  • Reader Services

  • Introduction

    • PostgreSQL Features

    • What Versions Does This Book Cover?

    • What Topics Does This Book Cover?

    • What's New in the Second Edition?

    • Part I:  General PostgreSQL Use

      • Chapter 1.  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

Tài liệu cùng người dùng

Tài liệu liên quan