---
title: "Postgres 12 is imminent"
publication: "Postgres Weekly"
issue: 325
published_at: "2019-10-02"
canonical_url: "https://postgresweekly.com/issues/325"
---

The latest Postgres news, articles, tools, and projects.       

#325 — October 2, 2019 

[Read on the Web](https://postgresweekly.com/issues/325)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1570014828/zx5lirn5agvejwtdfbwc.png)](https://www.postgresql.org/about/news/1975/)   

[Postgres 12 RC 1 Released, Final Due This Week?](https://www.postgresql.org/about/news/1975/) — The first release candidate of PostgreSQL 12 is now available for download. The final release is expected tomorrow, but we didn’t feel it was _100%_ enough to delay this issue but it will be on [postgresql.org](https://www.postgresql.org/) as soon as it’s out. 

PostgreSQL Global Development Group   

[On Implementing Transparent Data Encryption in Postgres](https://momjian.us/main/blogs/pgblog/2019.html#September_27_2019) — A brief update on a long term discussion over whether (and how) Postgres should implement TDE. In short, work is now underway, with work [on this TODO list](https://wiki.postgresql.org/wiki/Transparent_Data_Encryption#TODO_for_Full-Cluster_Encryption) hoping to be in place for Postgres 13. 

Bruce Momjian   [![\](https://copm.s3.amazonaws.com/8de32dc3.png)](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklyPrimary) 

[Free eBook: How to Get a 3x Performance Improvement on Your Postgres Database](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklyPrimary) — Learn our best practices for optimizing Postgres query performance for customers like Atlassian and how to reduce data loaded from disk by 500x. 

pganalyze sponsor   

[Hacker News Discusses.. Postgres or MySQL?](https://news.ycombinator.com/item?id=21040625) — There’s little more that can provoke a discussion on Hacker News than asking readers to choose between two technologies. Perhaps unsurprisingly, Postgres seems to be strongly preferred. 

Hacker News   

[Introducing phpPgAdmin 7.12.0](https://xzilla.net//blog/2019/Sep/Introducing-phpPgAdmin-7-dot-12-dot-0.html) — phpPgAdmin is a Web-based Postgres administration tool (in a similar vein to MySQL’s popular [phpMyAdmin](https://www.phpmyadmin.net/)). v7.12.0 moves to PHP 7 and supports all current versions of Postgres (including 12). 

xzilla   

[PostGIS 3.0 Beta 1 Released](http://postgis.net/2019/09/28/postgis-3.0.0beta1/) — Best used with Postgres 12, PostGIS is a popular Postgres extension that opens up the world of working with geospatial data at an advanced level from right within your database. 

PostGIS Developers   

[How to Run a Quick `ALTER TABLE` Without Long Locking Concurrent Queries](https://www.depesz.com/2019/09/26/how-to-run-short-alter-table-without-long-locking-concurrent-queries/) — An interesting workaround to a confusing problem. 

Hubert depesz Lubaczewski   

[How to Work with Postgres in Go(lang)](https://medium.com/avitotech/how-to-work-with-postgres-in-go-bad2dabd13e4) — An attempt at ‘arming you with experience’ of using PostgreSQL from Go (with [pgx](https://github.com/jackc/pgx), specifically), covering tools, drivers, logging, monitoring, and quirks to look out for. 

Artemiy Ryabinkov   

[Fixing `track_activity_query_size` in `postgresql.conf`](https://www.cybertec-postgresql.com/en/fixing-track_activity_query_size-in-postgresql-conf/) — By default, Postgres reserves up to 1024 bytes to track each query run which might not be enough for your monitoring or logging preferences. Here’s how to tweak the setting involved. 

Hans-Jürgen Schönig   

[Is Synchronous Replication a Trap?](http://rhaas.blogspot.com/2019/09/synchronous-replication-is-trap.html) — _“I think that a lot of people are using this technology and getting little or no benefit out of it, and some are actively hurting themselves.”_ 

Robert Haas   

[Take the Guesswork Out of Improving Query Performance](https://www.pgmustard.com/) — Based on the query plan, pgMustard offers you tips to make your query faster. Try it for free. 

pgMustard sponsor   

[How Much Faster is Redis at Storing a Blob of JSON Compared to Postgres?](https://www.peterbe.com/plog/redis-vs-postgres-blob-of-json) — If you’re familiar with [Redis](https://redis.io/), the in-memory data structure store, it won’t surprise you that it’s fast(!) but the use cases and pros and cons between Redis and Postgres are hugely different too. 

Peter Bengtsson   

[Understanding Heroku Postgres Log Statements and Common Errors](https://devcenter.heroku.com/articles/postgres-logs-errors) 

Heroku      supported by [![Datadog\](https://res.cloudinary.com/cpress/image/upload/v1566815662/buz6rhyghoxpslxmnfni.png)](https://www.datadoghq.com/postgres-monitoring/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-PostgresWeeklyTip)  

💡**Tip of the Week** 

The `INTERSECT` clause on `SELECT` 

Relational algebra and set theory form much of the basis of SQL and inspire many of its features. One such feature is the ability to _intersect_ the results of two queries against each other in the way that you might intersect two sets mathematically:   ![](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1569842492/dcsws9myvjc2yxmm2ltc.png) 

The intersection of A and B is made up of what A and B have in common.    

As an example, let's say you have a `customers` table which has a `address_id` column pointing to rows in an `addresses` table. We want to fetch all address IDs that are present in _both_ tables (that is, a customer record is pointing at an address _and_ that address exists):  

SELECT address_id FROM customers
 INTERSECT SELECT id FROM addresses;   

We can also do the converse if we want to return the address IDs that are referenced in the `customers` table but **are NOT present** in the `addresses` table itself. We do this using `EXCEPT` instead of `INTERSECT`:  

SELECT address_id FROM customers
 EXCEPT SELECT id FROM addresses;   

Note that order is important here. We're selecting address IDs from `customers` and then the ones that exist in `addresses` are being removed by `EXCEPT`. If we wanted to find the IDs of any addresses that are not being referenced from `customers`, we can spin the query around:  

SELECT id FROM addresses
 EXCEPT SELECT address_id FROM customers;   

If this has whet your appetite, [this tutorial by Lukas Eder](https://blog.jooq.org/2015/10/06/you-probably-dont-use-sql-intersect-or-except-often-enough/) goes into more detail with more examples and covers `UNION` as well. 

This week's tip is sponsored by [Datadog.](https://www.datadoghq.com/postgres-monitoring/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-PostgresWeeklyTip) Collect and monitor custom [PostgreSQL metrics in real-time with Datadog](https://www.datadoghq.com/postgres-monitoring/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-PostgresWeeklyTip).      

🗓**Upcoming Events** 

- [PostgreSQL Conference Europe 2019](https://2019.pgconf.eu/) (October 15-18 in Milan, Italy)
- [pgDay Santiago](https://www.pgday.cl/2019/) (October 29 in Santiago, Chile)
- [PG Down Under 2019](https://pgdu.org/) (November 15 in Sydney, Australia) — The second outing for this annual, Australian Postgres conference. The CFP remains open till next week.          

Curated by [Cooperpress](https://cooperpress.com/), [Peter Cooper](https://twitter.com/peterc), and [Craig Kerstiens](https://twitter.com/craigkerstiens). 

[Change your email address](https://postgresweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
