#​511 — June 21, 2023

Web Version

Together with  Sleuth

Postgres Weekly

🥇 Postgres: The Most Popular, Desired and Admired Database — Postgres has done well in Stack Overflow's latest developer survey, being the most ‘admired and desired’ database by a long shot. MySQL, SQLite, MongoDB and Redis trail behind in a second tier. In terms of popularity, Postgres took the top spot too for the first time ever, pushing MySQL into second place.

Stack Overflow

Making Postgres 30% Faster with Prepared Statements?Prepared statements can be faster than ad-hoc queries because they’re already parsed, planned, and ready to be executed. The PgCat Postgres pooler now supports prepared statements, so it’s even easier to take advantage.

Lev Kokotov (PostgresML)

[Checklist] Zero to 100 Deploys a Day — Not enough time to read through an eBook to learn how to deploy faster? Here's a quick milestone checklist to guide you through the steps, so you can go from deploying once a week up to 100 times a day.

Sleuth sponsor

Postgres Reconsiders Its Process-Based Model (Again)Last week, we featured the mailing list discussion about taking Postgres from its process-based model to a thread-based one, but this LWN post brings together the story into a single article.

Jonathan Corbet

💡 We subscribe to LWN and have used a special 'subscriber link' to enable you to read Jonathan's article. LWN is a great source of news in the Unix community and we encourage you to sign up if you work in that space.

IN BRIEF:

Postgres Documentation and the Limitations of Community — When it comes to docs, it’s the best of times, and the worst of times, suggests a major contributor to Postgres. While the project has a strong documentation process at its heart (patches require docs to be updated too), the docs have a jumbled up reference manual feel and aren’t so strong in a holistic, task-driven sense.

Robert Haas

Notably, Postgres is only 4th in the list of databases used by those "learning to code" in the Stack Overflow survey (above) so beginner oriented articles and guides may be a valuable part of the solution.

Native Enums or CHECK Constraints? — A look at the choice between using native enums or CHECK constraints to enforce data correctness, the pros and cons of each, and why the author went with CHECK constraints.

João Sampaio

Data Skews in Postgres — Skewed or uneven data is common but it can affect how well indexes work. This post includes a query for finding examples of such data in your own database and a.. partial fix for the indexing issue.

Elizabeth Christensen (CrunchyData)

Five Tips for Fast Analytics with Postgres

Hydra sponsor

More Fun with Postgres Puzzles — It might be the summer solstice (in the Northern Hemisphere) today but Greg is still focused on 2022’s Advent of Code challenges and solving them in Postgres. This post digs into day 17 and includes so many bits and pieces that you’re sure to learn something.

Greg Mullane (CrunchyData)

Unexpected Downsides of UUID Keys — UUIDs are handy if you want to generate keys independently of the database or blend records between databases without clashes but they lack temporal locality by default. Sequential UUIDs are in Postgres’ future though..

Ants Aasma

Deploying Pgpool on Kubernetes as a Load Balancer
Cary Huang

Code and Tools

pgMagic: Chat to Postgres Using Natural Language — A new macOS Postgres client (paid, but with a trial) from an indie dev that can use OpenAI to generate and execute queries against your database. There are a few experiments like this, but the presentation here is good and future versions are teased for Linux/Windows as well as a local inference option.

Tom Hill

pg_easy_replicate: Switch Databases with Minimal Downtime — A Ruby-powered orchestrator to simplify the task of setting up logical replication between two Postgres databases then letting you switch over to the newer one with minimal downtime.

Shayon Mukherjee

FerretDB v1.4.0: Feels Like MongoDB, Uses Postgres for Storage — Created in response to the confusion over MongoDB’s licensing model, FerretDB aims to be compatible with MongoDB but essentially acts as a proxy to Postgres on the backend. It could appeal to those left with MongoDB-based apps to maintain but who are tired of running MongoDB in production.

Alexander Fashakin

libpg_query: C Library for Accessing the Postgres Parser Externally
pganalyze

pgfs: fs.FS Implementation Atop Postgres's Large Objects API — One for the Go developers.
Mohamed Attahri