PostgreSQL in Action cover

PostgreSQL in Action

Rating 3.9
Word count
469K words
Chapters
23
Series
Database Technology Series
ISBN
9787111603467

Tags

Summary

PostgreSQL in Action is co-authored by Tan Feng and Zhang Wensheng, technical professionals long engaged in PostgreSQL operations and advocacy, written based on PostgreSQL 10 and positioned to "explain features clearly and stay close to production." The book has 18 chapters in three parts: Fundamentals, Core, and Advanced. The Fundamentals part (Chapters 1–4) starts with installation and configuration, covering both yum and source compilation installation methods, key configuration points of pg_hba.conf and postgresql.conf, usage tips for pgAdmin 4 and psql, and systematically reviews data types such as numeric, character, date and time, network address, array, range, and json/jsonb, as well as advanced SQL features such as WITH queries, batch inserts, RETURNING, UPSERT, data sampling, aggregate functions, and window functions. The Core part (Chapters 5–9) goes into the database's internals: logical and physical storage structures, process and memory structures, how parallel queries are executed and multi-table join strategies, transaction isolation levels and concurrency control based on locks and MVCC, partitioned tables, and NoSQL features. The Advanced part (Chapters 10–18) addresses production environments, discussing performance optimization, pgbench benchmarking, physical and logical replication, backup and recovery, high availability, version upgrades, extension modules, practical paths for migrating from Oracle to PostgreSQL, and PostGIS spatial data processing. The book includes numerous examples that can be verified hands-on and is suitable as a desk reference in daily work.

Editor's review

市面上讲 PostgreSQL 的书,大多在原理与操作之间有所偏重:有的把内核讲得深,却离日常运维很远;有的只列命令,看完仍然不敢在生产库上动手。《PostgreSQL实战》的可贵之处在于它按“能上手、能排查、能上线”的顺序组织内容:先让你把实例装好、连接配通,再拆解体系结构与并发控制,最后落到复制、备份、高可用、迁移这些真正考验 DBA 的环节。 两位作者都是国内 PostgreSQL 社区的活跃推动者,谭峰有六年专职 PostgreSQL DBA 经历,书中不少章节带着明显的现场痕迹,比如用 pageinspect 观察 MVCC、用 pg_repack 解决表膨胀、用 psql 定制日常维护脚本,这些细节往往正是新手卡住的地方。全书 18 章结构清晰,既可通读,也可按章节取用。 需要提醒的是,本书基于 PostgreSQL 10,部分语法与参数在新版本中已有变化(如分区表在后续版本中改为声明式分区),读者最好对照官方文档确认适用版本。但作为理解 PostgreSQL “为什么这样设计”的入门与参考书,它依然值得放在手边。

Who it's for

A good fit for

  • 已会基本的 SQL,想系统转入 PostgreSQL 的开发人员
  • 负责数据库日常运维、需要补齐备份复制与高可用技能的 DBA
  • 使用 PostgreSQL 的后端工程师,想弄懂查询优化与体系结构
  • 正在做 Oracle 等技术栈迁移评估的架构师和技术负责人
  • 高校数据库课程之外,想配合实验动手实践的学生

Not a good fit for

  • 完全没有数据库与 Linux 基础、需要从零入门的读者
  • 只想找一本最新版本特性速查手册的读者
  • 主要关注数据库内核源码剖析与编译原理的研究者

Reading tips

  1. 先通读基础篇并照着在虚拟机里装一遍 PostgreSQL 10,不要只翻代码。
  2. 核心篇建议对照 pg_class、pg_stat 等系统视图边读边查,理解而非背诵。
  3. 进阶篇的复制、备份、高可用部分可在测试环境搭主备后动手验证。
  4. 阅读时对照 PostgreSQL 官方文档,注意分区表、复制槽等特性后续版本的变化。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Preface
  2. Foreword
  3. Fundamentals
  4. Chapter 1: Installation and Configuration Basics
  5. Chapter 2: Client Tools
  6. Chapter 3: Data Types
  7. Chapter 4: Advanced SQL Features
  8. Core
  9. Chapter 5: Architecture
  10. Chapter 6: Parallel Queries
  11. Chapter 7: Transactions and Concurrency Control
  12. Chapter 8: Partitioned Tables
  13. Chapter 9: PostgreSQL's NoSQL Features
  14. Advanced
  15. Chapter 10: Performance Optimization
  16. Chapter 11: Benchmarking and pgbench
  17. Chapter 12: Physical and Logical Replication
  18. Chapter 13: Backup and Recovery
  19. Chapter 14: High Availability
  20. Chapter 15: Version Upgrades
  21. Chapter 16: Extension Modules
  22. Chapter 17: Migrating from Oracle to PostgreSQL
  23. Chapter 18: PostGIS

FAQ

这本书基于哪个 PostgreSQL 版本,还适用吗?
全书基于 PostgreSQL 10 编写,2018 年出版。SQL 基础、体系结构、并发控制等内容至今仍适用,但声明式分区、逻辑复制、并行查询等细节在新版本已有演进,实操时应参考对应版本的官方文档。
没有数据库基础能直接读吗?
不太建议。书中假定读者了解基本 SQL 和 Linux 命令操作,基础篇只是 PostgreSQL 层面的入门。零基础读者可先学 SQL 与 Linux,再回来看本书,效果会好很多。
这本书偏开发还是偏运维?
整体偏运维与架构,基础篇和核心篇兼顾开发,进阶篇的性能优化、复制、备份恢复、高可用、版本升级和迁移基本是 DBA 日常工作内容,也有助于开发理解线上约束。
和官方文档相比,这本书的价值在哪里?
官方文档是权威但分散的条目式参考,本书把安装配置、体系结构、优化、复制、高可用串成一条工程路径,并给出国内环境下的实操经验与踩坑提示,适合作为串线阅读与日常查阅的补充。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

谭峰 Author

Tan Feng: publicly available information is limited. The only confirmed identity detail is one work published under this name, From Rookie to Professional: A Growth Handbook for Newbie Reporters. Classified under language and writing, the book, judging by its title and category, is aimed at young people entering the news industry or students in related fields, offering introductory guidance on basic aspects such as interviewing, writing, and adjusting to the profession. The author organizes the book around the path from "rookie" to "professional," with an emphasis on practical, actionable advice rather than theoretical exposition, reflecting a writing approach that stays close to beginners' needs and focuses on passing on experience. Since only this one work is held in the collection, Tan Feng's other experiences, professional background, and full body of work cannot be verified, and further inference is inadvisable. This book alone occupies a place among introductory readings for new reporters and may serve readers interested in news writing and language expression.

张文升 Author

Zhang Wensheng — public information about this author is limited. The only known work is Smart + Retail: Business Transformation and Restructuring in the New Retail Era, which is classified under management. Judging from the title and category, the author focuses on the transformation of the retail industry against the backdrop of intelligent and digital technologies, discussing adjustments to business models and structural reorganization in the new retail era, and addressing the integration of technology application with business operations. The book is aimed at readers in retail and corporate management and seeks to sort out key issues in the industry's changes. Because verifiable information about the author's personal experience and background is extremely scarce, his professional identity and credentials cannot be confirmed; apart from this work, no further public record of his writing or industry influence is available, and readers should rely on the book itself for an understanding of his views.

More by the same author

Top rated in the same category