---
title: "This Week's PostgreSQL News (#122)"
publication: "Postgres Weekly"
issue: 122
published_at: "2015-09-09"
canonical_url: "https://postgresweekly.com/issues/122"
---

Postgres Weekly 122   . 

[Read this on the Web](http://postgresweekly.com/issues/122) 

[Postgres Weekly](http://postgresweekly.com) Issue 122 — September 9, 2015     

[Solving the Traveling Salesman Problem with Postgres Recursive CTEs](https://www.periscope.io/blog/postgres-recursive-cte.html?hn=&utm_source=postgresweekly&utm_medium=email)The simplest [CTEs are amazing for making readable queries](http://www.craigkerstiens.com/2013/11/18/best-postgres-feature-youre-not-using/), but CTEs can go far beyond being just a temporary view during a query. Recursive CTEs can essentially do a ‘for’ loop right in SQL - here’s a great example highlighting how that can be used. Periscope [PostgreSQL Magic](http://goto.project-a.com/postgresql-magic/?utm_source=postgresweekly&utm_medium=email)A look at some handy features in Postgres that would be ‘hard to replicate in MySQL’ including sequences, inserting and selecting data with one query (using RETURNING), arrays, and user-defined data types. Florian Brick [Want to work on new projects? Make more money? Try a new stack? Relocate?](https://hired.com/?utm_source=newsletters&utm_medium=postgresweekly&utm_campaign=n-q3_15-petercooperpress&utm_content=options)On Hired, we'll bring the options to you. With over 2,000 pre-screened tech companies in 10 cities in the US & UK, you'll be sure to find what you're looking for. Join Hired today. Hired.​com#sponsored[![\](https://copm.s3.amazonaws.com/6ef86532.png)](https://hired.com/?utm_source=newsletters&utm_medium=postgresweekly&utm_campaign=n-q3_15-petercooperpress&utm_content=options) [Common Misconceptions about Locking in Postgres](https://www.compose.io/articles/common-misconceptions-about-locking-in-postgresql/?utm_source=postgresweekly&utm_medium=email)General belief is that if you have locks on your database, you’re inviting problems, but the reality is more nuanced. Postgres has a variety of lock types which mean a variety of things and have various pros and cons as we see here. Robert M.​ Wysocki [MoSQL: A MongoDB to PostgreSQL Streaming Translator](https://github.com/stripe/mosql?utm_source=postgresweekly&utm_medium=email)Imports the contents of your MongoDB database cluster into a PostgreSQL instance, using an oplog tailer to keep the SQL mirror live up-to-date. This lets you run production services against a Mongo database, and then run offline reporting using SQL. Stripe#tools [Simple Index Checking with PostgreSQL](https://www.compose.io/articles/simple-index-checking-for-postgres/?utm_source=postgresweekly&utm_medium=email)Indexes are what will generally make your queries run faster, at least for most web apps making small queries. There’s some general rules of thumb that you can use as a guide - here’s a great run down of those rules as well as some queries to help you analyze your DB. Matt Barr [PostgreSQL Indexing with Ecto](http://rny.io/elixir/ecto/postgresql/2015/08/31/postgresql-indexing-with-ecto.html?utm_source=postgresweekly&utm_medium=email)If Postgres is your choice for your latest Elixir project, this post should get you all setup with proper indexing to make sure your app is performing as you’d hope. Richard Nyström [Django 1.8 and Postgres Meeting Notes from DjangoCon](https://docs.google.com/document/d/1iZwGp6sjiGmYwu0Jtk3XbAcU2Q5JywbrtX_3wLYNg08/edit?utm_source=postgresweekly&utm_medium=email#)DjangoCon is currently happening, and as part of that there’s been some great discussion around Django and it’s experience with Postgres. DjangoCon 2015 [PostgreSQL for Ruby Developers](https://gumroad.com/l/postgres?utm_source=postgresweekly&utm_medium=email)A paid/commercial e-book. Jesus Castello#news    

Postgres Weekly is curated by [Craig Kerstiens](https://twitter.com/craigkerstiens) [Read this issue on the Web](http://postgresweekly.com/issues/122) [See our archives](http://postgresweekly.com/issues) [Change your email address](*|UPDATE_PROFILE|*)  [Stop getting this newsletter](*|UNSUB|*)  

Published by [Cooperpress](https://cooperpress.com/)
Fairfield Enterprise Centre, Lincoln Way, Louth, LN11 0LS, UK
