PostgreSQL.pdf

所需积分/C币:33 2015-09-25 7.6MB PDF
评分

PostgreSQL是以加州大学伯克利分校计算机系开发的 POSTGRES,现在已经更名为PostgreSQL,版本 4.2为基础的对象关系型数据库管理系统(ORDBMS)。
Beginning Databases with PostgreSQL: From Novice to Professional, Second Edition Copyright o 2005 by Neil Matthew and Richard Stones All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN(pbk):1-59059-478-9 Printed and bound in the united states of america 987654321 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark cad editor: jason gilmore Contributing Author: Jon Parise Technical reviewer: robert treat Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser Assistant Publisher: Grace Wong Project Me er Sofia marchant Copy Manager: Nicole LeClerc Copy Editor: Marilyn Smith Production Manager: Kari Brooks-Copony Production editor: Katie stence Compositor: Susan glinert Proofreader: elizabeth b John Coll Artist: Kinetic Publishing Services, LLC Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski Distributed to the book trade in the United States by Springer-Verlag New York, Inc, 233 Spring Stre 6th Floor, New York, NY 10013, and outside the United States by Springer-Verlag gmbH Co. KG, Tiergar- tenstr. 17, 69112 Heidelberg, Germany In the United States: phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders@springer-ny com, or visit http://www.springer-ny.comOutsidetheUnitedsTates:fax+496221345229,e-mailorders@springer.de orvisithttp://www.springer.de For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710.pHone510-549-5930,fax510-549-5939,e-mailinfo@apress.comorvisithttp://www.apress.com The information in this book is distributed on an"as is"basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s)nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. Thesourcecodeforthisbookisavailabletoreadersathttp://www.apress.comintheDownloadssection Contents at a glance About the authors XVIl About the technical reviewer XIX Acknowledgments Introduction CHAPTER 1 Introduction to PostgreSQL CHAPTER 2 Relational Database Principles 17 ChAPTER 3 Getting Started with PostgreSQL CHAPTER 4 Accessing Your data ,,,73 CHAPTER 5 PostgreSQL Command-Line and Graphical Tools 113 CHAPTER 6 Data Interfacing ......,.. ..149 CHAPTER 7 Advanced data selection 173 chaPteR 8 Data Definition and Manipulation CHAPTER 9 Transactions and Locking 243 CHAPTER 10 Functions, Stored Procedures, and Triggers CHAPTER 11 PostgreSQL Administration 309 CHAPTER 12 Database design ,,357 CHAPTER 13 Accessing PostgreSQL from C Using libpq 385 CHAPTER 14 Accessing PostgreSQL from C Using Embedded SQL 419 CHAPTER 15 Accessing PostgreSQL from PHP 445 CHAPTER 16 Accessing PostgreSQL from Perl 5 CHAPTER 17 Accessing PostgreSQL from Java 491 CHAPTER 18 Accessing Postgre SQL from C# ,,,,,,,,,,,,,517 APPENDIXa PostgreSQL Database Limits 543 APPENDIX B PostgreSQL Data Types 545 CONTENTS AT A GLANCE APPENDIX C PostgreSQL SQL Syntax Reference 551 APPENDIX D psql Reference ,,,,573 APPENDIX E Database schema and tables 577 APPENDIX F Large objects Support in PostgreSQL INDEX 589 Contents About the authors 1日 XVIl About the technical reviewer XIX Acknowledgments Introduction CHAPTER 1 Introduction to PostgreSQL Programming With Data Constant data,.. Flat Files for Data storage 2 Repeating Groups and other Problems What Is a Database Management System? Database models Query Languages∴ Database Management system responsibilities 10 What Is PostgreSQL? A Short History of postgreSQL. 12 The PostgreSQL Architecture 13 Data Access with PostgreSQL What Is Open Source? Resources CHAPTER 2 Relational database principles 17 Limitations of Spreadsheets 17 Storing Data in a database Choosing columns 21 Choosing a Data Type for Each Column Identifying Rows Uniquely Accessing Data in a Database Accessing Data Across a Network ,,,,24 Handling Multiuser Access.....,,..........25 Slicing and Dicing Data 26 CONTENTS Adding Information Using Multiple Tables Relating a table with a join operation 29 Designing Table Understanding some basic rules of Thumb Creating a Simple Database Design Extending beyond two tables ,,,,,,,,,,,,,35 Completing the Initial Design Basic data types Dealing with the Unknown NULLS Reviewing the Sample Database 42 Summary 42 CHAPTER 3 Getting Started with PostgreSQL Installing PostgreSQL on Linux and UNIX Systems Installing Postgre SQL from Linux Binaries Anatomy of a PostgreSQl Installation stalling postgresQl from the Source code Setting Up postgreSQl on Linux and UNix..........53 Installing postgresQL on Windows ,,,,,,,,,,,,,59 Using the windows Installer..,.....,.,. Configuring Client Access ,64 Creating the sample database ,,,,64 Creating User Records Creating the Database Creating the tables Removing the Tables 68 Populating the tables ■■■ 自■ 量■■■■ Summary....... 72 CHAPTER 4 Accessing Your Data Jsing psql Starting Up on linux Systems ,,,,74 Starting Up on Windows Systems 74 Resolving Startup Problems........,,,......75 Using Some Basic psql commands 78 CONTENTS Using Simple seLecT Statements ,78 Overriding Column Names Controlling the Order of Rows Suppressing duplicates Performing calculations Choosing the rows Using more complex conditions ............................89 Pattern Matching...,,.... Limiting the results Checking for NULl Checking Dates and Times 94 Setting the Time and date Style ,,,94 Using date and Time Functions Working with Multiple Tables ,,,,,,,,,,,,,,,,,100 Relating TWo Tables ,,,100 Aliasing Table Names Relating three or More tables 106 The SQl92 SELECT Syntax 110 Summary... ,,,,112 CHAPTER 5 PostgreSQL Command-Line and graphical Tools...113 psql.... Starting psql...,,.,. 114 Issuing Commands in psql 114 Working with the Command History ,,,115 Scripting psql 115 Examining the database 117 psql command-Line Quick Reference 118 psql Internal commands Quick Reference ODBC Setup Installing the ODBC Driver 121 Creating a Data Source 123 pgAdminⅢ Installing pgAdminⅢ 125 Using pgAdmin Ill 126 phpPgAdmin Installing phpPgAdmin.……130 Using phpPgAdmin 130 CONTENTS Rekall Connecting to a Database Creating Forms Building Queries,,........,.......... 136 Microsoft Access ,,,137 Using Linked table 137 Entering Data and Creating Reports 量B Microsoft exce|∴ ,,142 Resources for postgreSQL Tools 146 mmary CHAPTER 6 Data Interfacing 149 Adding data to the Database 149 Using Basic INSERT Statements 149 Using Safer INSERT Statements Inserting Data into Serial Columns 154 Inserting NULL Values 158 Using the copy command................159 Loading Data Directly from another application........162 Updating Data in the database ................. 165 Using the UPDatE Statement 165 Updating from another table 168 Deleting Data from the Database Using the DELETE Statement 169 Using the trUncatE Statement 170 Summary∴ 171 CHAPTER 7 Advanced data selection Aggregate Functions 173 The count function ■m 174 The min function ,,182 The max Function The sum function The Avg Function.. The subquery Subqueries That return Multiple rows Correlated Subqueries Existence Subqueries 19 CONTENTS IX The union Join 192 Self joins ,,,194 Outer Joins Summary .......,.... 200 CHAPTER 8 Data Definition and Manipulation 201 Data Types The boolean data type.................. 202 Character Data types ,,204 Number Data Types 206 Temporal Data Types 209 Special Data Types 209 Arrays 210 Data Manipulation 212 Converting Between Data Types 212 Functions for Data Manipulation 214 Magic Variable 215 The oid column 216 Table Management.....................217 Creating tables 217 Using column Constraints...,..... .,,,,218 Using Table Constraints 222 Altering Table Structures Deleting Tables Using Temporary Tables Views∴ 228 CreatingⅥews... 228 Deleting and Replacing views 231 Foreign Key constraints 232 Foreign Key as a column constraint 233 Foreign Key as a table constraint Foreign Key Constraint Options 240 mmary 242 CHAPTER 9 Transactions and Locking ,,,,,,,,,,243 What are transactions? Grouping Data Changes into Logical Units 244 Concurrent multiuser access to data 244 ACID Rules 246 Transaction Logs 247

...展开详情
立即下载 最低0.43元/次 身份认证VIP会员低至7折
举报 举报 收藏 收藏
分享
4.12MB
PostgreSQL从入门到精通.pdf

PostgreSQL从入门到精通

2018-01-20 立即下载
27.88MB
PostgreSQL 9从零开始学.pdf

PostgreSQL 9从零开始学.pdf 个人收集电子书,仅用学习使用,不可用于商业用途,如有版权问题,请联系删除!

2017-03-30 立即下载
178.17MB
PostgreSQL实战.pdf 大小221MB PostgreSQL 10

本书基于PostgreSQL 10编写,重点介绍PostgreSQL的丰富特性以及生产实践运维技巧。全书共18章,分为基础篇、核心篇、进阶篇三部分。基础篇包括第1到4章,主要介绍PostgreSQL基础知识,例如安装、客户端工具、数据类型、SQL高级特性等,为读者阅读核心篇和进阶篇做好准备;核心篇包括第5到9章,主要介绍PostgreSQL核心内容

2019-03-10 立即下载
2MB
PostgreSQL数据库深入浅出.ppt

PostgreSQL是什么? PostgreSQL的体系架构 PostgreSQL的备份 PostgreSQL的集群方案 PostgreSQL VS MySQL PostgreSQL 功能专题

2018-05-22 立即下载
22.89MB
PostgreSQL11.2-CN-v1.0.pdf

PostgreSQL11.2中文文档

2020-04-29 立即下载
5.83MB
PostgreSQL教程.pdf

这篇 PostgreSQL 教程提供 SQL 的基本和高级概念。此 PostgreSQL 系列教程是专为初学 者和专业人士编写提供的,需要读者有一些基本的数据库和编程基础。

2019-05-30 立即下载
2.55MB
PostgreSQL 10 High Performance 无水印原版pdf

PostgreSQL 10 High Performance 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系csdn管理员删除 查看此书详细信息请在美国亚马逊官网搜索此书

2018-06-22 立即下载
34.77MB
【中文版】PostgreSQL即学即用 第2版.pdf

《PostgreSQL即学即用 第2版》, 作者:(美)奥贝,(美)徐著 , 页数:207 , 出版日期:2016.01

2017-07-19 立即下载
18.35MB
PostgreSQL数据库从入门到精通 第二.pdf )

postgresql python pg 数据库 从入门到精通

2012-11-15 立即下载
129.16MB
postgresql 教程 pdf 资料集合 .rar

postgresql 教程 pdf资料整理;内含多本资料,适合不同阶段的学习。

2019-06-12 立即下载
38.77MB
Postgresql书籍

Postgresql学习,个人书籍

2019-01-27 立即下载
img
Penny嗨

关注 私信 TA的资源

上传资源赚积分,得勋章
相关内容推荐