Relational Databases are great databases, and a good staple of any development stack when flexible querying ability is needed. Currently my main RDBMS is MySQL, but since the acquisition by Oracle I have been a bit turned off by it. Something always rubbed the wrong way as it was, but the purchase made me really want to move away. However, I never knew to what, or what to read to decide. This first chapter sealed the deal on my move to PostgreSQL for all non-wordpress and future projects.
Impressions of the Book
As noted above knowing what to read about PostgreSQL has been hard, but the book nailed what I wanted to know. I don’t really care too much about SQL Syntax, but what I wanted was more of the nitty gritty of how it worked along with what array of abilities it has. I got that and then some.
While some of the content was over my head because I have never had to deal with that kind of data storage and retrieval I could really see the flexibility incase I need to go there. The best part of the chapter is it was a deep dive with all the assumptions that I knew what I was doing with an RDBMS which allowed the content to be more specific.
What I Learned
For this database this section is going to be a bit small because I am used to RDBMS’s, but that doesn’t mean I didn’t learn anything. There are 3 key things that suck out in my head the most which I like, but are probably trivial to many other people. These might be in other database engines, I don’t know.
I had never thought about this before, but this is a great way to keep referential integrity without having to lookup id’s everywhere. Here is the code that drew my attention to it.
INSERT INTO events (title, starts, ends, venue_id) VALUES ('Mobi', '2012-02-06 21:00', '2012-02-06 23:00', ( SELECT venue_id FROM venues WHERE name = 'Crystal Ballroom' )
I specifically liked ILIKE which is case insensitive like vs a case sensitive LIKE. I have not seen this before and I remember running into an issue in the past, not sure what RDBMS, where I wanted all uppercase only, but kept getting mixed results. It is cool there is a distinction.
To be honest I had never thought about writing, or having, extra functionality in a database engine before from 3rd parties. This chapter not only showed me you can, but there is a lot of power in using them.
Chapter 1 was a great read, easy to follow and witty. Good amount of information in a short amount of time with not much fluff. It was a fairly deep dive as advertised for one reasonably length’d chapter. I really liked in the wrap-up where they talked about the strengths and weaknesses of PostgreSQL. However, I can only hope they expand on what they said in the weakness section in later chapters by detailing out how to use non-relational data.
I have high hopes for the future chapters as I was quite impressed by this first one. Join me next time for Riak.