Designing a PostgreSQL Document API

PostgreSQL as many know, supports JSON as a storage type and with the release of 9.4, Postgres now supports storing JSON as jsonb – a binary format. This is great news for people who want to...

Membership In a Box with PG-Auth

I mentioned in a previous post that I threw together some ideas one weekend on how to do membership completely within Postgres (users, roles, logs etc). It was fun and quite a few people asked if...

Document Storage Gymnastics with Postgres

With the release of Postgres 9.4 came the additional datatype jsonb. This is binary JSON, the same type of thing that MongoDB uses for internal storage. Postgres has had the json data type for a...

Embracing SQL In Postgres

One thing that drives me absolutely over the cliff is how ORMs try so hard (and fail) to abstract the power and expressiveness of SQL. Before I write further let me say that Frans Bouma reminded me...

Inserting And Using A New Record In Postgres

A Problem Postgres Can Solve Easily Let’s say you need to insert a record into a table and then use that record immediately to push data into another table. This happens a lot with parent/child...

Using Custom Types in Postgres

Using Types For Fun and Profit In my last post about pulling documents from queries I showed an interesting way to return a result set using row_to_json to crunch down 1-many records into a JSON...