---
title: "A fresh beta of Postgres 15"
publication: "Postgres Weekly"
issue: 462
published_at: "2022-07-06"
canonical_url: "https://postgresweekly.com/issues/462"
---

Plus keeping an eye on activities, an interesting SQL client, and managing reward programs with window functions. |        

#​462 — July 6, 2022 

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

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/ruzzofs1h8hvnvx0wqoz.jpg)](https://www.depesz.com/2022/07/05/understanding-pg_stat_activity/)  

[Understanding `pg_stat_activity`](https://www.depesz.com/2022/07/05/understanding-pg_stat_activity/) — `pg_stat_activity` provides an easy way to look at what different Postgres backend processes are up to. Hubert digs into what its various values actually represent. 

Hubert depesz Lubaczewski   

[PostgreSQL 15 Beta 2 Released](https://www.postgresql.org/about/news/postgresql-15-beta-2-released-2479/) — It’s to Postgres’s huge credit that a lot of effort is put into getting major releases _just right_ so it’s reassuring to see a second beta five weeks after the first with plenty of fixes. You’re encouraged to continue to help testing and the [updated (beta) release notes remain here.](https://www.postgresql.org/docs/15/release-15.html) 

PostgreSQL Global Development Group   [![\](https://copm.s3.amazonaws.com/e8e33aaa.png)](https://retool.com/?utm_source=sponsor&utm_medium=newsletter&utm_campaign=cooperpress) 

[With Retool, You Can Join Data from All Your Sources into One CRUD App](https://retool.com/?utm_source=sponsor&utm_medium=newsletter&utm_campaign=cooperpress) — Retool connects to your PostgreSQL database in minutes and makes it easy to build admin panels, dashboards, and utilities on top of your PostgreSQL data. Also, with Retool you can connect to your other data sources with a REST or GraphQL API — all in one internal app. 

Retool sponsor   

[How to Log Selects From a Specific Table?](https://www.depesz.com/2022/07/04/how-to-log-selects-from-specific-table/) — A practical introduction to using [PGAudit.](https://www.pgaudit.org/) It’s nice to have access to this sort of feature. 

Hubert depesz Lubaczewski   

[Transaction Anomalies with `SELECT FOR UPDATE`](https://www.cybertec-postgresql.com/en/transaction-anomalies-with-select-for-update/) — _“I was recently confronted with a nice example of how adding `FOR UPDATE` to a query can introduce transaction anomalies.”_ Luckily Laurenz has some tips for handling this situation. _(If you’re not aware, `FOR UPDATE` locks selected rows against concurrent updates, as you might want to do in a transaction.)_ 

Laurenz Albe   

**QUICK BITS:** 

- Postgres 14 [is now available](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/postgresql-v14-is-now-available-in-flexible-server-postgresql/ba-p/3563025) in the succinctly named _Azure Database for PostgreSQL Flexible Server._
- AWS Database Migration Service [now supports Babelfish](https://aws.amazon.com/about-aws/whats-new/2022/07/aws-database-migration-babelfish-aurora-postgresql/) for Aurora PostgreSQL as a target.
- If you're a Ruby on Rails developer, Rails has picked up [some Postgres specific improvements](https://rubyonrails.org/2022/7/4/this-week-in-rails-improved-postgresql-support-performance-improvements-and-more-e462895a) recently.
- GitLab has written about [its move to split its Postgres cluster into two:](https://about.gitlab.com/blog/2022/06/02/splitting-database-into-main-and-ci/) one for CI and one for everything else.   

[Queries in PostgreSQL: Nested Loops](https://postgrespro.com/blog/pgsql/5969618) — Egor’s detailed and highly technical Postgres posts are always welcome and he’s moved on to digging into join methods and how Postgres 14 introduced a handy technique to speed up repeated loops in particular. 

Egor Rogov   

[How to Reason About Indexing Your Postgres Database (On‑Demand Webinar)](https://pganalyze.com/webinars/how-to-reason-about-indexing-your-postgres-database?utm_source=PostgresWeeklySecondary07062022) 

pganalyze sponsor   

[Handling 'Bonus Programs' in SQL](https://www.cybertec-postgresql.com/en/handling-bonus-programs-in-sql/) — It’s always interesting to see how to bring logic into the database. This example orients around using window functions to collect data across time ranges, such as may be used by a corporate rewards scheme. 

Hans-Jürgen Schönig   

▶[Tuning the Postgres Statistics Target and Understanding Selectivity for Spatial Indexes](https://pganalyze.com/blog/5mins-postgres-tuning-statistics-target-selectivity-spatial-indexes) 
Lukas Fittl    

**🔧 Code and Tools:** 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/jfaiu6jppwopdnx9o3of.jpg)](https://antares-sql.app/)   

[Antares SQL: A New(ish) Open Source SQL Client](https://antares-sql.app/) — A cross-platform Electron-based client with some ambitious goals. Supports MySQL/MariaDB, Postgres, and SQLite so far, with more on the way. Looks promising! 

Fabio Di Stasio   

[OctoSQL: Join, Analyze, and Transform Data From Multiple Sources using SQL](https://github.com/cube2222/octosql) — A Go powered CLI tool for querying a ‘plethora’ of sources (including CSV files, JSON, MySQL, Postgres, Redis and Parquet) and even doing joins between them. 

Jacob Martin   

[The EverSQL Online SQL Query Optimization Tool](https://www.eversql.com/sql-query-optimizer/) — This is far from the first such tool, and it’s certainly not the simplest, but this index advisor covers numerous databases, including Postgres, and is worth a look. 

EverSQL   

**OTHER RELEASES:** 

[PostGIS 3.3.0beta1](https://postgis.net/2022/07/03/postgis-3.3.0beta1/)
 [PGSync 2.3](https://github.com/toluaina/pgsync) – Postgres to Elasticsearch sync.
 [node-pg-migrate 6.2.2](https://github.com/salsita/node-pg-migrate) – Node.js-based migration management.
 [data-diff 0.2.2](https://github.com/datafold/data-diff) – Efficiently diff rows across two different databases.
 [Citus 11.0.3](https://github.com/citusdata/citus) – Distributed Postgres as an extension.
 [SeaQuery 0.26](https://github.com/SeaQL/sea-query) – Dynamic SQL query builder for Rust.
 [pspg 5.5.5](https://github.com/okbob/pspg) – Unix pager for working with tables.    

**Got a new email?** You can [change your address here](https://postgresweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Postgres Weekly](https://postgresweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. Thanks! 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada. 

[Stop getting this newsletter.](https://postgresweekly.com/leave/*|UID|*)
