---
title: "Why 13 will be a lucky number for Postgres"
publication: "Postgres Weekly"
issue: 370
published_at: "2020-08-26"
canonical_url: "https://postgresweekly.com/issues/370"
---

Plus more news, tutorials, and tips from the Postgres world this week.       

#370 — August 26, 2020 

[Web Version](https://postgresweekly.com/issues/370)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/qvohl6d8lsat4yjyyyzj.jpg)](https://info.crunchydata.com/blog/why-postgresql-13-is-a-lucky-release)   

[Why Postgres 13 Will Be A 'Lucky' Release](https://info.crunchydata.com/blog/why-postgresql-13-is-a-lucky-release) — See why the author thinks that why 13, often maligned as an ‘unlucky’ number, will be lucky for Postgres it adds features like incremental sort, parallel vacuum, and improves performance of B-tree indexes. 

Jonathan S. Katz   

[`synchronous_commit` Options and Synchronous Standby Replication](https://www.percona.com/blog/2020/08/21/postgresql-synchronous_commit-options-and-synchronous-standby-replication/) — `synchronous_commit` lets you customize when a transaction commit can be acknowledged back to the client as successful which has implications in replicated systems. 

Jobin Augustine   [![\](https://copm.s3.amazonaws.com/9061c79f.png)](https://resources.2ndquadrant.com/postgresql-security-best-practices-whitepaper?utm_campaign=Whitepaper%20-%20Security%20Best%20Practices%20&utm_source=CooperPressSecurityWhitepaperAug26) 

[[Whitepaper\] Best Practices to Harden your Database](https://resources.2ndquadrant.com/postgresql-security-best-practices-whitepaper?utm_campaign=Whitepaper%20-%20Security%20Best%20Practices%20&utm_source=CooperPressSecurityWhitepaperAug26) — Learn the fundamental concepts of Security for PostgreSQL Databases & develop a deep understanding of industry best practices. Discover how to secure your Postgres cluster & keep your data safe. Have confidence your database is adequately protected from attacks. 

2ndQuadrant Whitepapers sponsor   

[Improvements for Handling Large Number of Connections Coming to Postgres 14](https://www.depesz.com/2020/08/25/waiting-for-postgresql-14-improvements-for-handling-large-number-of-connections/) — Note that this is about Postgres _14_ so you’re going to be waiting a while (as 13 isn’t even out yet!) but handling large numbers of connections is a perennial issue for many so these links to some discussion threads may be of interest. 

Hubert depesz Lubaczewski   

[Query 40K+ Datasets Through a 'Data Delivery Network' With Any Postgres Client](https://www.splitgraph.com/) — Splitgraph offers what they call a ‘data delivery network’ that acts like a distributed SQL caching proxy compatible with the Postgres wire protocol. In this demo it lets you query over 40,000 datasets with SQL using the `psql` or other Postgres clients you know and love. 

Splitgraph   

[Calculating Standard Deviation with SQL](https://momjian.us/main/blogs/pgblog/2020.html#August_21_2020) — As is often the case, Postgres offers a function for this task: `stddev()`. 

Bruce Momjian   

[A Look at TLS Related Updates Coming in Postgres 13](https://www.highgo.ca/2020/08/21/tls-related-updates-in-postgresql-13/) — Supporting a minimum of TLS 1.2, Postgres 13 brings a few improvements when it comes to secure connections including support for channel binding. 

Cary Huang   

[How to Setup Postgres on an IPv6 Enabled Network](https://www.highgo.ca/2020/08/21/how-to-setup-postgresql-on-an-ipv6-enabled-network/) — If you’re confident with IPv6 already, this goes into more depth than you’ll need, but if not.. you may find some useful tips here. 

David Zhang   

[Faster CI/CD for All Your Software Projects - Try Buildkite ✅](https://buildkite.com/?pk_campaign=postgres_speed_nocr_ch_aug_20&pk_source=cp&pk_medium=newsletter) — See how Shopify scaled from 300 to 1800 engineers while keeping their build times under 5 minutes. 

Buildkite sponsor   

[pg-costop: Vector Arithmetic and Weighted, Variably Randomized Cosine Similarity Search](https://github.com/turbo/pg-costop) — Mathemetically this is a bit beyond me but it’s a set of PL/pgSQL functions for working with vectors to calculate cosine proximity / similarity rankings. 

turbo   

[pg-shortkey: YouTube-like Short IDs as Postgres Primary Keys](https://github.com/turbo/pg-shortkey) — _“This installs a trigger and type which allow you to use YouTube-like short IDs (e.g. 1TNhBqYo-6Q) as Postgres Primary Keys. Just like YouTube IDs, ‘SHORTKEY’ IDs are fixed length and URL-safe.”_ 

turbo   

[QuestDB: A Performance-Focused 'NewSQL' Time-Series Database System](https://www.questdb.io/) — A relational database (that isn’t built on Postgres but _does_ support its wire protocol) focused on fast time-series data processing. Built in Java. 

QuestDB Limited   

[Pgpool-II 4.1.3, 4.0.10, 3.7.15, 3.6.22 and 3.5.26 Released](https://www.postgresql.org/about/news/2062/) — Bug fixes all round for all maintained versions of the popular connection pooling system. 

PgPool Development Group      supported by [![YugabyteDB\](https://res.cloudinary.com/cpress/image/upload/v1593529453/obtljl96reuhv3jzrxqr.png)](https://download.yugabyte.com/?utm_source=postgres_weekly&utm_medium=tip_of_week&utm_campaign=aug262020)  

💡**Tip of the Week** 

Checking for the existence of a row 

You could check for the existence of a row on a Postgres table by just requesting that row and seeing if anything comes back, but depending on how you did this, the result may be ambiguous or inefficent. 

The [`EXISTS` subquery expression](https://www.postgresql.org/docs/8.1/functions-subquery.html) can be used to unambiguously determine if another query returns any rows or not, and it can therefore be used to detect if a particular row exists:  

# CREATE TABLE test(id BIGSERIAL PRIMARY KEY);
 # INSERT INTO test(id) VALUES (13);
 # SELECT EXISTS(SELECT 1 FROM test WHERE id=11) AS "exists";
 exists
 --------
 f
 (1 row)
 
 # SELECT EXISTS(SELECT 1 FROM test WHERE id=13) AS "exists";
 exists
 --------
 t
 (1 row)   

`EXISTS` always returns a boolean – true or false. 

This week’s tip is sponsored by [YugabyteDB](https://download.yugabyte.com/?utm_source=postgres_weekly&utm_medium=tip_of_week&utm_campaign=aug262020), the high-performance, cloud native, open source distributed SQL database. YugabyteDB EXISTS to help power your business-critical apps at scale. [Get started.](https://download.yugabyte.com/?utm_source=postgres_weekly&utm_medium=tip_of_week&utm_campaign=aug262020)          

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
