---
title: "The tale of two little regexes"
publication: "Postgres Weekly"
issue: 385
published_at: "2020-12-09"
canonical_url: "https://postgresweekly.com/issues/385"
---

Plus the future is Postgres compatibility, a UUID generation benchmark, and a 'top' clone for Postgres. |       

🤭 Believe it or not, next week is the last full week before Christmas.. so next week we'll be doing a roundup of the most interesting and newsworthy items of 2020 before taking our Christmas break. See you then! :-)
__
_Peter Cooper, your editor_   

#385 — December 9, 2020 

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

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1607518322/d1nj838ojgba9lfbq8hr.png)](https://blog.coinbase.com/seamless-mongodb-to-postgresql-migration-127735cc989c)  

[A Seamless MongoDB to PostgreSQL Migration](https://blog.coinbase.com/seamless-mongodb-to-postgresql-migration-127735cc989c) — Coinbase is a large digital currency exchange so having a solid foundation for its data is a must. Here they share some lessons learned from a large cross-database data migration to AWS RDS PostgreSQL. 

Alex Ghise (Coinbase)   

[Replacing Lines of Code with 2 Little Regexes in Postgres](https://info.crunchydata.com/blog/replacing-lines-of-code-with-2-little-regexs-in-postgresql) — I love them but the term ‘regular expression’ admittedly sends many developers running for the hills. Is there a good use for them with Postgres? Yes, and Steve shows one off here. 

Steve Pousty   [![\](https://copm.s3.amazonaws.com/718fcb4e.png)](https://www.cockroachlabs.com/webinars/the-architecture-of-a-distributed-sql-database-dec2020?utm_campaign=cooperpress-2020-Q4&utm_source=postgresweekly&utm_medium=sponsor&utm_content=postgresweekly-primary) 

[▶️ Future of Database Architecture is Postgres Compatible](https://www.cockroachlabs.com/webinars/the-architecture-of-a-distributed-sql-database-dec2020?utm_campaign=cooperpress-2020-Q4&utm_source=postgresweekly&utm_medium=sponsor&utm_content=postgresweekly-primary) — The language and the tools that you use with Postgres are important for your efficiency. Join us on Dec 16 for a live tech talk to learn how and why database architecture is evolving without leaving Postgres behind. [Save your spot](https://www.cockroachlabs.com/webinars/the-architecture-of-a-distributed-sql-database-dec2020?utm_campaign=cooperpress-2020-Q4&utm_source=postgresweekly&utm_medium=sponsor&utm_content=postgresweekly-primary). 

CockroachDB sponsor   

[When to Use Hyperscale (Citus) to Scale Out Postgres](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/when-to-use-hyperscale-citus-to-scale-out-postgres/ba-p/1958269) — Citus by Citus Data is now a part of Microsoft (though remains [open source](https://github.com/citusdata/citus)) and is a powerful way to _horizontally_ scale Postgres. In this article, Claire explains when and why you’d need this sort of power. 

Claire Giordano (Microsoft)   

[Cleaning Up the `BLOB`s](https://www.cybertec-postgresql.com/en/blob-cleanup-in-postgresql/) — `BLOB` is the SQL standard’s binary string type which differs slightly to Postgres’s `bytea` approach, but either way, you need to take care if using the BLOB interface (such as via `lo_import`) for bringing binary data into your database because imported data can be left sitting around in your database even when you thought you deleted it. 

Hans-Jürgen Schönig   

[Using Postgres Aggregate Functions in YugabyteDB to Analyze COVID-19 Data](https://blog.yugabyte.com/using-postgresql-aggregate-functions-in-yugabytedb-to-analyze-covid-19-data/) — Yugabyte is a Postgres-compatible ‘NewSQL’ database and here’s a practical look at using SQL functions for linear regression analysis of coronavirus statistics. 

Bryn Llewellyn   

[A V4 UUID Generation Benchmark](https://shusson.info/post/benchmark-v4-uuid-generation-in-postgres) — `uuid_generate_v4` vs `gen_random_uuid`.. fight! And the result is not even close. 

Shane Husson   

[Wondering How You Should Optimize a Particular Query?](https://pganalyze.com/docs/explain?utm_source=PostgresWeeklySecondary12092020) — pganalyze uses auto_explain to automatically collect EXPLAIN plans. Identify slow sequential scans, sorts on disk & more. 

pganalyze sponsor   

[Restoring An Individual Postgres Table](https://thomasvilhena.com/2020/11/restoring-individual-postgres-table) — What if you want to restore an individual table from a dump? 

Thomas Vilhena   

[Upgrading and Updating Postgres](https://www.cybertec-postgresql.com/en/upgrading-and-updating-postgresql/) — Updating (such as from 12.0 to 12.1, say) is a different ball game to _upgrading_ (such as from 12 to 13) and there are a few tools to consider. 

Hans-Jürgen Schönig   

[Comparing Options for Bulk Loading into Postgres](https://www.highgo.ca/2020/12/08/bulk-loading-into-postgresql-options-and-comparison/) — A comparison of `COPY`, `\copy`, `file_fdw`, and `pg_bulkload` for loading in 624MB of CSV data under different scenarios. 

Muhammad Usama    

🔧**Tools and Code**  

[A Look at `pgtop`, A `top` Clone for Postgres](https://dev.to/cosimo/pgtop-a-top-clone-for-postgresql-319) — Another way to look at currently running queries. 

Cosimo Streppone   

[pgagroal 1.0: High-Performance Connection Pool for Postgres](https://agroal.github.io/pgagroal/) — Has a lot of features and makes a lot of promises, including [being extremely fast.](https://github.com/agroal/pgagroal/blob/master/doc/PERFORMANCE.md) — [GitHub repo.](https://github.com/agroal/pgagroal) 

Agroal   

[pg-shortkey: YouTube-Like Short IDs as Postgres Primary Keys](https://github.com/turbo/pg-shortkey) — A trigger for your database that lets you use YouTube-like URL-safe short IDs (e.g. oHg5SJYRHA0) as primary keys, if you wish. We first linked this a few months ago but [Hacker News found it](https://news.ycombinator.com/item?id=25288188) and a fun discussion ensued. 

turbo   

[pg-listen: Postgres `LISTEN` and `NOTIFY` for Node.js](https://github.com/andywer/pg-listen) — If you’re using Node.js and wish to use Postgres as a message broker with its notification channels, this will help. (If you’re unfamiliar with this Postgres feature, [this article will help.](https://tapoueh.org/blog/2018/07/postgresql-listen-notify/)) 

Andy Wermke    

**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! 

--- 

**Want to sponsor?** Email `[kristina@cooperpress.com](mailto:kristina@cooperpress.com)` for details. 

--- 

**Want more?** You might like [DB Weekly](https://dbweekly.com/?utm_source=pg&utm_medium=email&utm_campaign=footer-promo), our more general database newsletter covering data storage trends, new database types, and more. 

--- 

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

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