PostgreSQL 9 Administration Cookbook: LITE Edition
By Simon Riggs
3/5
()
About this ebook
Read more from Simon Riggs
PostgreSQL 9 Administration Cookbook LITE: Configuration, Monitoring and Maintenance Rating: 3 out of 5 stars3/5PostgreSQL 11 Administration Cookbook: Over 175 recipes for database administrators to manage enterprise databases Rating: 0 out of 5 stars0 ratings
Related to PostgreSQL 9 Administration Cookbook
Related ebooks
Instant Redis Optimization How-to Rating: 0 out of 5 stars0 ratingsPostgreSQL Development Essentials Rating: 5 out of 5 stars5/5HBase Essentials Rating: 0 out of 5 stars0 ratingsInstant PostgreSQL Backup and Restore How-to Rating: 0 out of 5 stars0 ratingsPractical OneOps Rating: 0 out of 5 stars0 ratingsPostgreSQL Server Programming Rating: 0 out of 5 stars0 ratingsTroubleshooting CentOS Rating: 0 out of 5 stars0 ratingsLearning SaltStack Rating: 4 out of 5 stars4/5Troubleshooting PostgreSQL Rating: 5 out of 5 stars5/5Git Best Practices Guide Rating: 0 out of 5 stars0 ratingsLearning Elasticsearch 7.x: Index, Analyze, Search and Aggregate Your Data Using Elasticsearch (English Edition) Rating: 0 out of 5 stars0 ratingsMastering Ansible - Second Edition Rating: 0 out of 5 stars0 ratingsGetting Started with Grunt: The JavaScript Task Runner Rating: 3 out of 5 stars3/5Python Data Persistence Rating: 0 out of 5 stars0 ratingsMonitoring Docker Rating: 0 out of 5 stars0 ratingsPostgreSQL Administration Essentials Rating: 0 out of 5 stars0 ratingsLearning .NET High-performance Programming Rating: 0 out of 5 stars0 ratingsMonitoring Elasticsearch Rating: 0 out of 5 stars0 ratingsCentOS High Performance Rating: 0 out of 5 stars0 ratingsMastering Play Framework for Scala Rating: 0 out of 5 stars0 ratingsInstant Play Framework Starter Rating: 0 out of 5 stars0 ratingsLearning Azure DocumentDB Rating: 0 out of 5 stars0 ratingsSpark Cookbook Rating: 0 out of 5 stars0 ratingsAnsible DevOps Cookbook Rating: 0 out of 5 stars0 ratingsSolr in Action Rating: 3 out of 5 stars3/5Django 1.0 Template Development Rating: 0 out of 5 stars0 ratingsPostgreSQL Replication - Second Edition Rating: 0 out of 5 stars0 ratingsOpa Application Development Rating: 0 out of 5 stars0 ratingsMastering SaltStack - Second Edition Rating: 0 out of 5 stars0 ratingsAlfresco 3 Cookbook Rating: 0 out of 5 stars0 ratings
Information Technology For You
Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5DevOps Handbook: What is DevOps, Why You Need it and How to Transform Your Business with DevOps Practices Rating: 4 out of 5 stars4/5A Mind at Play: How Claude Shannon Invented the Information Age Rating: 4 out of 5 stars4/5Learning Microsoft Endpoint Manager: Unified Endpoint Management with Intune and the Enterprise Mobility + Security Suite Rating: 0 out of 5 stars0 ratingsCyber Security Consultants Playbook Rating: 0 out of 5 stars0 ratingsHacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5CompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 5 out of 5 stars5/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsCOMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsMicrosoft Access for Beginners and Intermediates Rating: 0 out of 5 stars0 ratingsCreating your MySQL Database: Practical Design Tips and Techniques Rating: 3 out of 5 stars3/5The iPadOS 17: The Complete User Manual to Quick Set Up and Mastering the iPadOS 17 with New Features, Pictures, Tips, and Tricks Rating: 0 out of 5 stars0 ratingsData Management Fundamentals (DMF) - CDMP exam preparation Rating: 0 out of 5 stars0 ratingsPersonal Knowledge Graphs: Connected thinking to boost productivity, creativity and discovery Rating: 5 out of 5 stars5/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsAWS Certified Cloud Practitioner: Study Guide with Practice Questions and Labs Rating: 5 out of 5 stars5/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsExcel VBA: A Step-By-Step Tutorial For Beginners To Learn Excel VBA Programming From Scratch: 1 Rating: 4 out of 5 stars4/5Random Tech Rating: 0 out of 5 stars0 ratingsDNS in Action Rating: 0 out of 5 stars0 ratingsCybersecurity Playbook for Executives Rating: 0 out of 5 stars0 ratingsOracle JD Edwards EnterpriseOne 9.0: Supply Chain Management Cookbook Rating: 0 out of 5 stars0 ratings
Reviews for PostgreSQL 9 Administration Cookbook
1 rating0 reviews
Book preview
PostgreSQL 9 Administration Cookbook - Simon Riggs
Table of Contents
PostgreSQL Administration Cookbook: LITE
Credits
About the Authors
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. First Steps
Introduction
Introducing PostgreSQL 9
What makes PostgreSQL different?
Getting PostgreSQL
How to do it...
How it works...
There's more...
Connecting to PostgreSQL server
Getting ready
How to do it...
How it works...
Inspecting your connection information
See also
Enabling access for network/remote users
How to do it...
How it works...
There's more...
See also
Using graphical administration tools
How to do it...
How it works...
There's more...
See also
Using psql query and scripting tool
Getting ready
How to do it...
How it works...
There's more...
See also
Changing your password securely
How to do it...
How it works...
Avoiding hardcoding your password
Getting ready
How to do it...
How it works...
There's more...
Using a connection service file
How to do it...
How it works...
Troubleshooting a failed connection
How to do it...
There's more...
2. Exploring the Database
Introduction
What version is the server?
How to do it...
How it works...
There's more...
What is the server uptime?
How to do it...
How it works...
Locate the database server files
Getting ready
How to do it...
How it works...
There's more...
Locate the database server message log
Getting ready
How to do it...
How it works...
Getting ready
How to do it...
How it works...
There's more...
List databases on this database server?
How to do it...
How it works...
There's more...
How many tables in a database?
How to do it...
How it works...
There's more...
How much disk space does a database use?
How to do it...
How it works...
How much disk space does a table use?
How to do it...
How it works...
There's more...
Which are my biggest tables?
How to do it...
How many rows in a table?
How to do it...
How it works...
Quick estimate of the number of rows in a table
How to do it...
How it works...
There's more...
Function 1
Function 2
Understanding object dependencies
Getting ready
How to do it...
How it works...
There's more...
3. Database Administration
Introduction
Writing a script that either all succeeds or all fails
How to do it...
How it works...
There's more...
Writing a psql script that exits on first error
Getting ready
How to do it...
How it works...
There's more...
Performing actions on many tables
Getting ready
How to do it...
How it works...
There's more...
Using pg_batch to run tasks in parallel
Adding/Removing the columns of a table
How to do it...
How it works...
There's more...
Changing datatype of a column
Getting ready
How to do it...
How it works...
There's more...
Adding/Removing schemas
How to do it...
There's more...
Schema-level privileges
Moving objects between schemas
How to do it...
How it works...
There's more...
Adding/Removing tablespaces
Getting ready
How to do it...
How it works...
There's more...
Putting pg_xlog on a separate device
Tablespace-level tuning
Moving objects between tablespaces
Getting ready
How to do it...
How it works...
There's more...
Accessing objects in other PostgreSQL databases
Getting ready
How to do it...
How it works...
There's more...
See also
Making views updateable
Getting ready
How to do it...
How it works...
There's more...
Index
PostgreSQL Administration Cookbook: LITE
PostgreSQL Administration Cookbook: LITE
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2011
Production Reference: 1130411
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK.
ISBN 978-1-849516-20-4
www.packtpub.com
Cover Image by John M. Quick ( <john.m.quick@gmail.com> )
Credits
Authors
Simon Riggs
Hannu Krosing
Reviewers
Gabriele Bartolini
Dimitri Fontaine
Acquisition Editor
Sarah Cullington
Technical Editor
Hithesh Uchil
Indexer
Hemangini Bari
Production Coordinator
Kruthika Bangera
Cover Work
Kruthika Bangera
About the Authors
Simon Riggs is a major developer and one of the few committers on the PostgreSQL database project, as well as CTO of 2ndQuadrant, providing 24x7 support and services to PostgreSQL users worldwide.
Simon works actively as a database architect and support troubleshooter, skills which drive and shape his contributions to the development of operational features for PostgreSQL. Feature credits include Point in Time Recovery, Warm Standby replication, Hot Standby, Asynchronous Commit, Partitioning and many other performance and tuning features. His designs and solutions can be found throughout the PostgreSQL code and documentation.
Simon has also previously worked with Oracle, Teradata, and DB2 and holds multiple certifications. His previous experience covers management and senior technical roles in the banking, telecommunications, and software industries. Simon's early research work has been published by the Royal Society.
Hannu Krosing is a principal consultant at 2ndQuadrant and a Technical Advisor at Ambient Sound Investments. As the original database architect at Skype Technologies, Hannu was responsible for designing the Skytools suite of replication and scalability technologies. Hannu has more than 12 years experience working with and contributing to the PostgreSQL project.
About the Reviewers
Gabriele Bartolini is a long time open-source programmer, writing Linux/Unix applications in C and C++ for over 10 years, specializing in search engines and web analytics with large databases.
Gabriele has a degree in Statistics from the University of Florence. His areas of expertise are data mining and data warehousing, having worked on web traffic analysis in Australia and Italy.
Gabriele is a consultant with 2ndQuadrant and an active member of the international PostgreSQL community.
Gabriele currently lives in Prato, a small but vibrant city located in the northern part of Tuscany, Italy. His second home is Melbourne, Australia, where he has studied at Monash University and worked in the ICT sector.
His hobbies include calcio
(football or soccer, depending on which part of the world you come from) and playing his Fender Stratocaster electric guitar.
Thanks to my family, in particular Cathy who encourages me by saying there is always something new to learn.
Dimitri Fontaine is part of the PostgreSQL community and has been contributing to open source for more than 10 years. He is the lead developer of enterprise ready solutions such as pgloader (ETL), PostgreSQL prefix indexing (telephony routing), pg_staging (development environment maintenance from production backups), preprepare (allow easy usage of prepare statements behind a connection pooler), and some backports of recent PostgreSQL features
He also contributed to Skytools and the Londiste replication system and, authored a PHP layer for the PGQ event handler, allowing for robust asynchronous processing and code reuse.
Dimitri's passion is system architecture & design, with the goals of reduced maintenance time and very high availability
Professional experience, community involvement, and PostgreSQL expertise have led Dimitri to now work as a principal consultant at 2ndQuadrant, France.
Preface
PostgreSQL is an advanced SQL