---
title: "An introduction to SCRAM authentication in Postgres 13"
publication: "Postgres Weekly"
issue: 367
published_at: "2020-08-05"
canonical_url: "https://postgresweekly.com/issues/367"
---

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

#367 — August 5, 2020 

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

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1596547416/qmn0lierqiaaytaamyxd.jpg)](https://www.percona.com/blog/2020/07/28/migrating-to-postgresql-version-13-incompatibilities-you-should-be-aware-of/)  

[Postgres 13 Incompatibilities To Be Be Aware Of](https://www.percona.com/blog/2020/07/28/migrating-to-postgresql-version-13-incompatibilities-you-should-be-aware-of/) — Postgres 13 will be in general release soon (it’s currently [in beta](https://www.postgresql.org/about/news/2047/)) and while Postgres _tends_ to be reasonably backward compatible over time, there are some changes worth being aware of before you make a migration, as seen here. 

Ibrar Ahmed   

[How to Securely Authenticate with SCRAM in Postgres 13](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/how-to-securely-authenticate-with-scram-in-postgres-13/ba-p/1548319) — A tutorial on setting up SCRAM-based password authentication. Interesting not just as a tutorial but also a primer on what SCRAM _is_ and why channel binding improves security overall. 

Jeff Davis   [![\](https://copm.s3.amazonaws.com/bf1363e0.png)](https://www.enterprisedb.com/postgres-tutorials/how-tune-postgresql-guc-parameters?utm_source=Cooperpress&utm_medium=ad) 

[How to Tune PostgreSQL GUC Parameters](https://www.enterprisedb.com/postgres-tutorials/how-tune-postgresql-guc-parameters?utm_source=Cooperpress&utm_medium=ad) — This article discusses GUC parameters that can be used for PostgreSQL tuning and how to configure them for improved performance. [Take a look](https://www.enterprisedb.com/postgres-tutorials/how-tune-postgresql-guc-parameters?utm_source=Cooperpress&utm_medium=ad). 

EDB sponsor   

[Measuring the Difference Between Dates](https://momjian.us/main/blogs/pgblog/2020.html#August_3_2020) — _“What is the difference between two dates? You would think there was one answer, but there isn’t.”_ An interesting look at how there are multiple ways to get the difference between two dates or timestamps in Postgres and how they can return slightly different answers. 

Bruce Momjian   

[`effective_cache_size`: A Practical Example](https://www.cybertec-postgresql.com/en/effective_cache_size-a-practical-example/) — Some insights and a practical example of what the `effective_cache_size` setting does. 

Hans-Jürgen Schönig   

[Announcing pgBackRest for Azure: Fast, Reliable Postgres Backups](https://info.crunchydata.com/blog/announcing-pgbackrest-for-azure-fast-reliable-postgres-backups) — Backups are a key staple of running any database. [pgBackRest](https://pgbackrest.org/) aims to be a fast, reliable, easy-to-use backup and restore solution with the ability to seamlessly scale to the largest databases, and now there’s official support for Azure. 

Craig Kerstiens   

[Connection Pooling in Pgpool-II](https://b-peng.blogspot.com/2020/07/connection-pooling-in-pgpool.html) — [Pgpool-II](https://pgpool.net/mediawiki/index.php/Main_Page) is a connection pooling tool for Postgres – this post looks at the basics of its operation. 

B Peng   

[Best-Practices on How to Speed Up Your Postgres Queries. Free eBook](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklySecondary08052020) — Companies like Robinhood and Atlassian are able to speed up their queries by orders of magnitude. This eBook shares our best practices for optimizing Postgres performance. 

pganalyze sponsor   

▶[How to use SSL in Postgres The Right Way: Encrypt Your Data in Transit](https://www.youtube.com/watch?v=Y1lsbF9NWW0) 

Kirill Shirinkin   

[Continuous Backups using WAL-G](https://supabase.io/blog/2020/08/02/continuous-postgresql-backup-walg/) — [WAL-G](https://github.com/wal-g/wal-g) lets you manage the archiving of Postgres data and backups and can also let you restore a database to its state at a particular moment in time. 

Angelico de los Reyes   

[Computing `INTERVAL` Values](https://momjian.us/main/blogs/pgblog/2020.html#July_31_2020) — Bruce seems to be on a date and time streak this week, and here he looks at some quirks of date/time intervals. 

Bruce Momjian   

▶[High Performance HTAP with Postgres & Hyperscale (Citus)](https://www.youtube.com/watch?v=xGWVVTva434) 

Marco Slot and Claire Giordano      supported by [![PopSQL\](https://res.cloudinary.com/cpress/image/upload/v1594299945/m0snjqfahpmeztbh7ilv.png)](https://popsql.com/?utm_source=pgweekly&utm_campaign=5august)  

💡**Tip of the Week** 

The `FORMAT` function 

When a fresh Postgres tip doesn't immediately come to mind, one of my favorite techniques is to look at the (amazing) Postgres documentation and skim through until I find something I didn't know about before but that I think might be useful in future. So it goes today with [the `FORMAT` function!](https://www.postgresql.org/docs/12/functions-string.html#FUNCTIONS-STRING-FORMAT) 

If you're familiar with `format`, `printf` or `sprintf` in various languages like Python, C, or Ruby, you'll know what a _format string_ is – a string using a simple template language made up of special delimiters which can be replaced by supplied values. Postgres offers the same idea in the `FORMAT` function:  

SELECT FORMAT('%s %s', 'hello', 'world');
 /* => 'Hello world' */
 
 SELECT FORMAT('|%10s|', 'test');
 /* => '| test|' */
 
 SELECT FORMAT('INSERT INTO %I VALUES(%L, %L)',
 'people', 'pat', null);
 /* => 'INSERT INTO people VALUES('pat', NULL)' */   

Sadly, `FORMAT` isn't anywhere near as powerful as string formatting languages in non-SQL languages (there's no `%d` or `%f`, for example) but you could find it useful for bringing together multiple columns into a preferred form of output (such as a column of cents into a formatted price):  

SELECT FORMAT('$%s', ROUND(cents / 100, 2));   

Be sure to check out [the official documentation for more](https://www.postgresql.org/docs/12/functions-string.html#FUNCTIONS-STRING-FORMAT) if you plan to use `FORMAT`. 

Try out this Tip in [PopSQL.](https://popsql.com/?utm_source=pgweekly&utm_campaign=5august) PopSQL is a SQL editor built for teams. Write queries, visualize data, and share your results. A free premium trial awaits Postgres Weekly readers (no credit card required).          

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
