Beginning Databases with PostgreSQL: From Novice to Professional

Front Cover
Apress, Nov 3, 2006 - Computers - 664 pages

PostgreSQL is arguably the most powerful open-source relational database system. It has grown from academic research beginnings into a functionally-rich, standards-compliant, and enterprise-ready database used by organizations all over the world. And it’s completely free to use.

Beginning Databases with PostgreSQL offers readers a thorough overview of database basics, starting with an explanation of why you might need to use a database, and following with a summary of what different database types have to offer when compared to alternatives like spreadsheets. You’ll also learn all about relational database design topics such as the SQL query language, and introduce core principles including normalization and referential integrity.

The book continues with a complete tutorial on PostgreSQL features and functions and include information on database construction and administration. Key features such as transactions, stored procedures and triggers are covered, along with many of the capabilities new to version 8. To help you get started quickly, step-by-step instructions on installing PostgreSQL on Windows and Linux/UNIX systems are included.

In the remainder of the book, we show you how to make the most of PostgreSQL features in your own applications using a wide range of programming languages, including C, Perl, PHP, Java and C#. Many example programs are presented in the book, and all are available for download from the Apress web site.

By the end of the book you will be able to install, use, and effectively manage a PostgreSQL server, design and implement a database, and create and deploy your own database applications.

 

Contents

Introduction to PostgreSQL
1
CHAPTER
3
CHAPTER
5
CHAPTER
6
CHAPTER
8
CHAPTER
10
CHAPTER
11
CHAPTER
13
Functions Stored Procedures and Triggers
268
Procedural Languages
276
Anatomy of a Stored Procedure
282
SQL Functions
298
Why Use Stored Procedures and Triggers?
306
PostgreSQL Administration
309
Database Design
357
Accessing PostgreSQL from C Using libpq
385

Accessing PostgreSQL from C Using Embedded SQL 419
15
CHAPTER
16
Relational Database Principles
17
CHAPTER
18
Accessing Data in a Database
23
Designing Tables
32
APPENDIX
40
Getting Started with PostgreSQL
43
Installing PostgreSQL on Windows
59
Summary
72
Accessing Your Data
73
PostgreSQL CommandLine and Graphical Tools
113
ODBC Setup
121
phpPgAdmin
129
Data Interfacing
149
Updating Data in the Database
165
Summary
171
Advanced Data Selection
173
The Subquery
185
Data Definition and Manipulation
201
Foreign Key Constraints
232
Transactions and Locking
243
Functions Stored Procedures and Triggers
267
Accessing PostgreSQL from C Using libpq
386
Executing SQL with libpq
392
Printing Query Results
401
Dealing with Binary Values
411
Summary
417
Accessing PostgreSQL from C Using Embedded SQL
419
Accessing PostgreSQL from PHP
445
Getting and Setting Character Encoding
459
Accessing PostgreSQL from Perl
465
Accessing PostgreSQL from Perl
466
Using DBI
472
Easy
484
Accessing PostgreSQL from Java
491
Making Database Connections
498
Accessing PostgreSQL from C
517
APPENDIX A PostgreSQL Database Limits
543
APPENDIX B PostgreSQL Data Types
545
PostgreSQL SQL Syntax Reference
551
psql Reference
573
APPENDIX E Database Schema and Tables
577
INDEX
589
Copyright

Other editions - View all

Common terms and phrases

About the author (2006)

Richard Stones graduated from university with an electrical engineering degree, but decided software was more fun. He has programmed in a variety of languages, but only admits to knowing Visual Basic under duress. He has worked for a number of companies, from the very small to the very large, in a variety of areas, from real-time embedded systems upward. He is employed by Celesio AG as a systems architect, working principally on systems for the retail side of the business. He has co-authored several computing books with Neil Matthew, including Beginning Linux Programming, Professional Linux Programming, and Beginning Databases with MySQL.

Bibliographic information