---
title: "A way to simulate time travel on your database"
publication: "Postgres Weekly"
issue: 413
published_at: "2021-07-07"
canonical_url: "https://postgresweekly.com/issues/413"
---

Plus row-level locks, faster Oracle migrations, and how distributed JOINs work in practice. |        

#​413 — July 7, 2021 

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

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/fsov0xxtno1flu4npziy.jpg)](https://www.cybertec-postgresql.com/en/simulating-temporal-tables-with-dblink-and-replication-delay/)   

[Simulating Temporal Tables with `dblink` and Replication Delay](https://www.cybertec-postgresql.com/en/simulating-temporal-tables-with-dblink-and-replication-delay/) — A curious look at using delayed streaming replication and [dblink](https://www.postgresql.org/docs/10/contrib-dblink-function.html) (a way to execute queries on remote databases via another SQL query) to simulate temporal tables (i.e. to look back in time). This is such an odd but clever approach. 

Kaarel Moppel   

[A Look at Row-Level Locks](https://postgrespro.com/blog/pgsql/5968005) — A practical demo of how row-level locks are managed in Postgres and can be used together with object-level locks. 

Egor Rogov   [![\](https://copm.s3.amazonaws.com/2b999d82.jpg)](https://tsdb.co/tutorials-db-all) 

[🌟 Time-Series 101: Get 10+ Tutorials, Sample Datasets & More](https://tsdb.co/tutorials-db-all) — [Explore 10+ tutorials](https://tsdb.co/db-tutorials-all) - complete with sample datasets and SQL queries - to get up and running with time-series data analysis. Topics range from analyzing crypto trends to DevOps & IoT monitoring, building awesome visualizations & beyond. 🚀 

Timescale sponsor   

[Understanding `pg_repack`: What Can Go Wrong and How to Avoid It](https://www.percona.com/blog/2021/06/24/understanding-pg_repack-what-can-go-wrong-and-how-to-avoid-it/) — [pg_repack](https://reorg.github.io/pg_repack/) is a tool to remove bloat from tables and indexes, and optionally restore the physical order of clustered indexes, without holding an exclusive lock over said tables, but it’s not without its pain points. 

Jobin Augustine   

[Ora2PG Now Supports `oracle_fdw` to Increase Data Migration Speed](https://www.migops.com/blog/2021/07/01/ora2pg-now-supports-oracle_fdw-to-increase-the-data-migration-speed/) — [Ora2Pg](https://ora2pg.darold.net/) is an open source Oracle to Postgres migration tool and it can now use [oracle_fdw](https://github.com/laurenz/oracle_fdw) for faster performance, particularly on tables using BLOB columns. This is due to the new versions [v22.0 and 22.1](https://www.postgresql.org/about/news/ora2pg-v220-and-221-released-2252/) having just been released (with more features than just the above). 

Gilles Darold   

**IN BRIEF:** 

- Postgres has [two new committers](https://www.postgresql.org/message-id/624364.1625085838@sss.pgh.pa.us). Welcome to Daniel Gustafsson and John Naylor.
- Daniel Westermann is the latest [PostgreSQL Person of the Week](https://postgresql.life/post/daniel_westermann/) and has been questioned on his favorite Postgres tools, extensions, and events.
- Fly, an app deployment platform, has written about how they enable [the use of globally-replicated Postgres](https://fly.io/blog/globally-distributed-postgres/) for both reads and writes on their platform.   

[Postgres Permissions and Materialized Views](https://blog.rustprooflabs.com/2021/07/postgres-permission-mat-view) — Materialized views let you persist the result of a query, but keeping them suitably refreshed by a non-owner can require some work on the permissions. 

Ryan Lambert   

[Instant Realtime APIs on Postgres with Authorization | Get Started for Free in 30s](https://cloud.hasura.io/?utm_campaign=pgweekly1-july21&utm_medium=email&utm_source=newsletter) 

Hasura sponsor   

▶[New Ways to Get Started with Azure Database for PostgreSQL](https://www.youtube.com/watch?v=YPXhi6WaDZI) — A snappy 20-minute introduction to running Postgres on Azure, particularly in its Citus-flavored ‘Hyperscale’ form. Claire is one of the most prolific suppliers of links to Postgres Weekly, by the way, so it’s neat to see her talking about Postgres live. 

Scott Hanselman and Claire Giordano   

[How JOINs Between Local and Distributed Postgres Tables Work with Citus](https://www.citusdata.com/blog/2021/07/02/citus-tips-joins-between-local-and-distributed-postgres-tables/) — [Citus](http://docs.citusdata.com/en/v10.0/get_started/what_is_citus.html) makes it possible to distribute tables across multiple nodes in a cluster and even to JOIN between them. This post is a basic introduction to how it works. 

Sait Talha Nisanci   

[Paranoid SQL Execution on Postgres](https://ardentperf.com/2021/07/06/paranoid-sql-execution-on-postgresql/) — Jeremy thinks of some ideas to execute SQL with a “paranoid” level of safety, by using timeouts, fully qualifying the names of things, using hot standbys, and more. 

Jeremy Schneider    

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

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