Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering PostgreSQL 15 - Fifth Edition

You're reading from  Mastering PostgreSQL 15 - Fifth Edition

Product type Book
Published in Jan 2023
Publisher Packt
ISBN-13 9781803248349
Pages 522 pages
Edition 5th Edition
Languages
Author (1):
Hans-Jürgen Schönig Hans-Jürgen Schönig
Profile icon Hans-Jürgen Schönig

Table of Contents (16) Chapters

Preface Chapter 1: PostgreSQL 15 Overview Chapter 2: Understanding Transactions and Locking Chapter 3: Making Use of Indexes Chapter 4: Handling Advanced SQL Chapter 5: Log Files and System Statistics Chapter 6: Optimizing Queries for Good Performance Chapter 7: Writing Stored Procedures Chapter 8: Managing PostgreSQL Security Chapter 9: Handling Backup and Recovery Chapter 10: Making Sense of Backups and Replication Chapter 11: Deciding on Useful Extensions Chapter 12: Troubleshooting PostgreSQL Chapter 13: Migrating to PostgreSQL Index Other Books You May Enjoy

Handling various formats

So far, we have seen that pg_dump can be used to create text files. The problem here is that a text file can only be replayed completely, so if we have saved an entire database, we can only replay the entire thing. In most cases, this is not what we want to do. Therefore, PostgreSQL has additional formats that offer more functionality.

At this point, four formats are supported:

-F, --format=c|d|t|p  output file  format (custom, directory, tar, plain  text  (default))

We have already seen plaintext, which is just normal text. On top of that, we can use a custom format. The idea behind a custom format is to get a compressed dump, including a table of contents. Here are two ways to create a custom format dump:

[hs@linuxpc ~]$ pg_dump -Fc test > /tmp/dump.fc
[hs@linuxpc ~]$ pg_dump -Fc test -f /tmp/dump.fc

In addition to the table of contents, the compressed dump has one more advantage: it is a lot smaller...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}