---
title: "Simple SQL queries that'll get you thinking"
publication: "Postgres Weekly"
issue: 529
published_at: "2023-11-08"
canonical_url: "https://postgresweekly.com/issues/529"
---

Plus digging into Postgres internals, Timescale gets dynamic, and France loves Postgres. |        

#​529 — November 8, 2023 

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

Together with [![Epsio\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,e_trim,w_345,h_155/e_make_transparent/co_white,e_outline:10/mmeowbxba1ikxyqjznii.png)](https://docs.epsio.io/)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/cnztjdobei13tdsxzjxr.jpg)](https://www.hezmatt.org/~mpalmer/blog/2023/11/07/postgresql-encryption-options.html)  

[Postgres Encryption: The Available Options](https://www.hezmatt.org/~mpalmer/blog/2023/11/07/postgresql-encryption-options.html) — When it comes to encryption, you’re on your own with vanilla Postgres out of the box, but various layers of data security are available from those provided by your hardware to Postgres extensions (e.g. [pgsodium](https://github.com/michelp/pgsodium)) or app-level defences. This post provides a brief overview, and also provoked [an extensive Hacker News discussion](https://news.ycombinator.com/item?id=38173141) on the topic. 

Matt Palmer   

[Using Multiple Triggers on the Same Table](https://www.cybertec-postgresql.com/en/use-multiple-triggers-same-table-postgresql/) — What happens if you deploy many triggers on the very same table? What order do the multiple triggers fire in? Hans-Jürgen indulges in some of his usual experimentation to find out! 

Hans-Jürgen Schönig   [![\](https://copm.s3.amazonaws.com/95f9aed5.png)](https://docs.epsio.io/) 

[Streaming PostgreSQL Queries with Epsio](https://docs.epsio.io/) — Boost the performance of your most complex queries by plugging Epsio into your database. Epsio constantly prepares and updates results for queries you define whenever the underlying data changes, without ever recalculating the entire dataset. 

Epsio sponsor   

[Writing a Storage Engine for Postgres: An In-Memory Table Access Method](https://notes.eatonphil.com/2023-11-01-postgres-table-access-methods.html) — Phil summed up this _tour de force_ post best: _“I’ve been working this week to understand Postgres Table Access Methods for alternative storage engines. Especially challenging because the documentation is pretty sparse and few minimal implementations exist. I wrote up my approach!”_ 

Phil Eaton   

✍️ Phil's post comes from a recent effort to [encourage folks to 'dig into Postgres internals' and write about it.](https://eatonphil.com/2023-10-wehack-postgres.html) This has resulted in some fascinating, but particularly technical, posts such as [Non-Local Jumps with `setjmp` and `longjmp`.](https://dipeshkaphle.github.io/posts/nonlocaljumps/)  

[Timescale Introduces _Dynamic PostgreSQL_](https://www.timescale.com/blog/introducing-dynamic-postgresql/) — Boldly claiming to be ‘the next evolution of the database’, this is ultimately an innovation upon Timescale’s Postgres _platform_, but an interesting one nonetheless. _Dynamic PostgreSQL_ provides a consistent baseline of performance but can instantaneously scale compute within a pre-defined range – they call this model _“buy the base, rent the peak.”_ 

Freedman and Godeke (Timescale)   

**IN BRIEF:** 

- 📅 _pgDay Paris 2024_ has opened [a call for speakers](https://2024.pgday.paris/call-for-papers/) – the event takes place in Paris, France in March 2024 and the submission deadline is December 22.
- 🇫🇷 We also take this opportunity to remember that Postgres is [officially recommended](https://www.postgresql.org/message-id/505DA7CB.1070205@dalibo.info) by the French government. _Vive la Postgres!_
- 🇳🇴 Taking place just days before _pgDay Paris_, [Nordic pgDay 2024](https://2024.nordicpgday.org/) is in Oslo, Norway next March and [their CFP is open too.](https://2024.nordicpgday.org/cfp/)
- 🎧 The _Path to Citus Con_ podcast had Dimitri Fontaine and Vik Fearing on [to discuss whether every data problem can – or should – be solved in SQL.](https://pathtocituscon.transistor.fm/episodes/solving-every-data-problem-in-sql-w-dimitri-fontaine-vik-fearing) If you're the sort of person who ponders using PL/pgSQL for _Advent of Code_, this is for you.
- ✍️ Andrew Atkinson is back from Manhattan and [has a recap of PGConf NYC 2023](https://andyatkinson.com/blog/2023/10/10/pgconf-nyc-2023) to share with us.   

🤯 [SQL Scoping is Surprisingly Subtle and Semantic](https://buttondown.email/jaffray/archive/sql-scoping-is-surprisingly-subtle-and-semantic/) — Justin presents us with a very simple set of SQL queries and asks us to predict what they’ll return. I’d be surprised if you got them right. A fun look at some potentially unintuitive (but standardized) SQL behavior. 

Justin Jaffray   

[How Timescale Scaled Postgres to 350 TB+ (with 10B New Records/Day)](https://www.timescale.com/blog/how-we-scaled-postgresql-to-350-tb-with-10b-new-records-day/) — For their new _Insights_ database observability tool, specifically. 
Rob Kiefer (Timescale)   

[Easy Row Level Security (RLS) Policies in Supabase and Postgres](https://maxlynch.com/2023/11/04/tips-for-row-level-security-rls-in-postgres-and-supabase/) 
Max Lynch   

[How To Install Postgres and pgAdmin on WSL2](https://ak-codes.com/wsl2-postgres-setup/) 
Andraz   

[A Kubernetes-Based pgAdmin Tutorial](https://www.highgo.ca/2023/11/06/managing-postgresql-like-a-pro-a-kubernetes-based-pgadmin-tutorial/) 
Tristen Raab    

Code and Tools  

[pgext: A Bare, Minimal Postgres Extension](https://github.com/eatonphil/pgext-101) — And there’s no Rust in sight! This is a small C based extension template that provides the bare minimum to be considered a usable Postgres extension. 

Phil Eaton   

[DoltgreSQL: Postgres-Compatible Database with Version Control Concepts](https://www.dolthub.com/blog/2023-11-01-announcing-doltgresql/) — [Dolt](https://github.com/dolthub/dolt) is a long standing Go-powered database providing a ‘`git` for data’ type experience with branching, cloning, merging and more, but using the MySQL wire protocol. DoltgreSQL offers the same but over the Postgres wire protocol - hurrah! 

Daylon Wilkins   

[Find Your Partner in Code and Work #LikeABosch](https://www.bosch.com/careers/why-bosch/collaboration-and-leadership/?utm_campaignid=postgres&utm_source=cooperpress&utm_medium=cpc&utm_campaign=wlab&utm_term=brief&utm_content=pairprogramming) 

Bosch sponsor   

[PGLoader: A Data Loading Tool for Migrating to Postgres](https://github.com/dimitri/pgloader) — A long-standing data loading tool that supports parallelism and can load in data that may be partially erroneous but without stopping (as `\copy` might). Recently referenced in [this MySQL to Postgres migration story.](https://www.stefanwienert.de/blog/2023/10/25/migrate-from-mysql-to-postgresql-rails/) 

Dimitri Fontaine   

- [Credcheck 2.3](https://www.postgresql.org/about/news/credcheck-version-23-released-2745/) – Automatically check credentials during user creation.
- [FerretDB 1.14.0](https://github.com/FerretDB/FerretDB/releases/tag/v1.14.0) – It looks like MongoDB, but with Postgres in the back.
- [asyncpg 0.29.0](https://github.com/MagicStack/asyncpg) – A Postgres client libary for asyncio in Python.
- [Sequelize 6.34.0](https://github.com/sequelize/sequelize) – Feature-rich ORM for Node.js.    

**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|*).
