PostgreSQL

PostgreSQL

JSON vs hstore: Which will get you into a cool bar in the Mission?

After all, isn’t that the most important issue?

Craig Kerstiens has a good overview of what the two types are. I wanted to give a quick and dirty flowchart as to which one I would use in a green-field development situation.

First, hstore performs better than JSON in nearly every situation, but performance is (as I wrote on

PostgreSQL as a Schemaless Database

My presentation from FOSDEM 2013, PostgreSQL as a Schemaless Database, is now posted (sorry for the delay!).

The Text Type… If That’s Your Real Name.

tl;dr: Don’t give tables the same name as base PostgreSQL types, even though it will let you.

It’s interesting how synchronicity can occur. In my talk about custom PostgreSQL types in Python, I mentioned that any time you create a table in PostgreSQL, you’re also creating a type: the row type of the table.

While

You Cannot Recover From the Loss of a Tablespace

tl;dr: Each and every tablespace is critical to the operation of your PostgreSQL database. If you lose one, you’ve lost the entire database.

This one can be short and sweet: If you use tablespaces in PostgreSQL, each and every one of them is a critical part of your database. If you lose one, your database is corrupted,

Why you want WAL archiving as well as streaming replication

A client of ours recently had me log into their server to set up a tablespace scheme for them. While I was in, I noticed that the secondary of the streaming replication pair wasn’t connecting to the primary. A quick check showed that the primary had been moved from one internal IP address to another, and in doing so everything

pgbadger

For years, the standard log analysis tool for PostgreSQL has been pgfouine (For those wondering, a “fouine” in French is a beech marten; as the saying goes, I am none the wiser, if somewhat better informed.) However, pgfouine seems to have stalled as a project; there haven’t been updates in a while, it requires a patch to work with

The Elements of postgresql.conf Style

… or, inexcusable things I am tired of seeing in postgresql.conf files.

PostgreSQL Performance When It’s Not Your Job

My presentation from SCALE 10x, “PostgreSQL Performance When It’s Not Your Job” is now available for download.

“Sharding & IDs at Instagram”

I’d like to recommend an interesting post, “Sharding & IDs at Instagram”, about sharding using Postgres.

Cleaning up after your Bucardo goats

If you are not familiar with it already, Bucardo is a nifty multi-master replication system for PostgreSQL, written by Greg Sabino Mullane. Written in Perl, it is great if you need replication that doesn’t have the restrictions associated with PG 9’s streaming replication.

To keep your Bucardo installation clean and tidy, a few regular cron jobs are