Upgrade to Pro — share decks privately, control downloads, hide ads and more …

3 Awesome Things Postgres Can Do

3 Awesome Things Postgres Can Do

I gave this as a lightning talk at Steel CIty Ruby Conference 2012.

PostgreSQL is a great database and can do more than just store relational data. It can store key-values, display pivot data, and has great full text search implementations.

Jesse Dearing

August 04, 2012
Tweet

More Decks by Jesse Dearing

Other Decks in Programming

Transcript

  1. HStore • It’s a key-value column • It’s queryable •

    It’s in Rails 4 • You can use it now with activerecord- postgres-hstore
  2. Trigram Matching • Breaks strings up into 3 character chunks

    • cat => [‘ c’, ‘ca’, ‘cat’, ‘at ‘] • Used as a human friendly search • Doesn’t rely on breaking out words so .coms in merchant names match • Helps with misspellings: ‘eharmoney’ find eHarmony
  3. tablefunc • normal_rand • Normally distributed random values (Gaussian distribution)

    • crosstab • Pivot displays • connectby • Displays hierarchical data