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

Postgres Weekly 174   . 

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

[Postgres Weekly](http://postgresweekly.com) Issue 174 — September 14, 2016     

[Yandex's Successful Migration From Oracle to PostgreSQL [PDF\]](https://www.pgcon.org/2016/schedule/attachments/426_2016.05.19%20Yandex.Mail%20success%20story.pdf?utm_source=postgresweekly&utm_medium=email)Yandex is one of the larger email service providers in the world. At PgCon they gave a [talk](https://www.youtube.com/watch?v=-SS4R1sFH3c) of how they migrated 300TB from Oracle to Postgres–a pretty impressive feat. Vladimir Borodin [A Tour of Postgres' Foreign Data Wrappers](http://www.craigkerstiens.com/2016/09/11/a-tour-of-fdws/?utm_source=postgresweekly&utm_medium=email)Even if your data isn’t in a SQL database, you can use Postgres to connect to other data sources via foreign data wrappers (FDWs). Craig Kerstiens#tutorial [Handling Very Large Tables in Postgres Using Partitioning](https://engineering.heroku.com/blogs/2016-09-13-handling-very-large-tables-in-postgres-using-partitioning/?utm_source=postgresweekly&utm_medium=email)Partitioning can help restore query performance and deal with large volumes of data over time without having to resort to changing to a different data store. Rimas Silkaitis#tutorial [Join us at DataLayer](https://datalayer.com/?utm_source=cooper&utm_medium=newsletter&utm_campaign=datalayer)Hear speakers from GitHub, Artsy, ZenDesk and many others as they discuss how their teams are optimizing the data layer to scale modern web and mobile apps. Reserve your seat now for this one day event on Sept. 28 in Seattle. Compose | DataLayer#sponsored[![\](https://copm.s3.amazonaws.com/a76b330c.png)](https://datalayer.com/?utm_source=cooper&utm_medium=newsletter&utm_campaign=datalayer) [Unique Partial Indexes with PostgreSQL](https://medium.com/little-programming-joys/unique-partial-indexes-with-postgresql-86e137905c12?utm_source=postgresweekly&utm_medium=email)Unique indexes aren’t new, but in certain cases you need your data to be unique based on some value. Conditional indexes are the answer and aren’t too complicated to put in place. Anderson Dias [PGConf Silicon Valley (Nov 15-16) Schedule Now Live](http://www.pgconfsv.com/program?utm_source=postgresweekly&utm_medium=email)PGConf Silicon Valley is back. If you’re interested in attending [early bird tickets](https://www.eventbrite.com/e/pgconf-silicon-valley-2016-tickets-24414801328) are on sale and we’ve got a discount code for 10% off if you use code`PostgresWeekly.` PGConf Silicon Valley#news [Uniqueness in PostgreSQL: Constraints vs Indexes](http://flatiron.engineering/technology/2016/09/13/uniqueness-in-postgres.html?utm_source=postgresweekly&utm_medium=email)Constraints and indexes come at a cost: they add write overhead with each INSERT and UPDATE and they can take up significant amounts of space. Since they both enforce uniqueness, which should we prefer and how are they different? Lauren Ellsworth#tutorial [Calculating Proportional Values in SQL](https://www.periscopedata.com/blog/calculating-proportional-values.html?utm_source=postgresweekly&utm_medium=email)Aggregations are common and generally straightforward in SQL, but some more complex operations like medians require a bit more work as demonstrated here. Periscope#tutorial [Creating a Postgres Cluster using Helm, a Kubernetes Package Manager](http://blog.kubernetes.io/2016/09/creating-postgresql-cluster-using-helm.html?utm_source=postgresweekly&utm_medium=email) Jeff McCormick#tutorial [Getting PostgreSQL Transactions Under Control with SQLAlchemy](http://layer0.authentise.com/getting-postgresql-transactions-under-control-with-sqlalchemy.html?utm_source=postgresweekly&utm_medium=email) Authentise, Inc#tutorial [Fun with SQL: Computing Run Rate & Month Over Month Growth](https://www.citusdata.com/blog/2016/09/12/fun-with-sql-computing-run-rate-and-growth-with-ctes-and-window-functions/?utm_source=postgresweekly&utm_medium=email)A walk through a complex query which calculates run rates and percentage growth rate over time for an ‘as-a-service’ business. It breaks the query apart step by step and leverages a number of Postgres features such as CTEs and window functions. Citus Data#tutorial [Recovering a Postgres Database From Disk Level Corruption](http://www.pateldenish.com/2016/09/recovering-corrupted-postgres-database.html?utm_source=postgresweekly&utm_medium=email)When disk corruption occurs, there’s a number of steps you can take. This post does a good job of walking through one case of disk corruption and how they recovered data. Denish Patel#tutorial [pg-histogram: Functions for Generating Text-Based Histograms](https://github.com/wolever/pg-histogram?utm_source=postgresweekly&utm_medium=email)This handy set of functions makes it easy to generate text-based histograms directly in Postgres. David Wolever#code [Find Your Perfect Company Match](https://hired.com/?utm_source=newsletters&utm_medium=petercooperpress&utm_campaign=q3-16-postgresweekly)You're smart, you're efficient. Why job hunt the old way? Try Hired and get your profile in front of thousands of top tech companies. Hired.​com#sponsored    

Postgres Weekly is curated by [Craig Kerstiens](https://twitter.com/craigkerstiens) [Read this issue on the Web](http://postgresweekly.com/issues/174) [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
