Whenever I want to try something new with a PostgreSQL DB the first thing I do is check if there is someone else out there who has already encountered my problem and has solved it for me. Around 90% of the time I find the perfect solution and the problem is solved in minutes.
So where can you find help on PostgreSQL?
My first stop is Google, which usually leads me to http://www.postgresql.org/. The official PostgreSQL website has detailed documentation about all of the different parts of the PostgreSQL DB.
Until a few weeks ago when I didn’t find my answer online I would try to build my own solution from scratch. But then I read a great book called “PostgreSQL 9 Admin Cookbook”. It contains recipes for many of the different problems you encounter when working with PostgreSQL. It has clear explanations that beginners will have no trouble understanding, and it has great examples so that even pros will learn some new things. I really like the “cookbook” format that allows you to read only those chapters or recipes that fit the specific problem you want to solve, or the specific topic you want to learn about.
While I went through the book I found myself learning a lot about several parts of the PostgreSQL DB that I wasn’t familiar with, understanding a bit about how things work under the hood, and learning from the examples and SQL code in the different recipes. For example there are some great recipes on identifying and removing duplicate data, creating test data, tweaking the PostgreSQL configuration parameters, finding the longest running queries in your DB, and finding locks in the DB. These are just some of the great recipes that the book contains.
So if you haven’t done so yet – go check it out!