# Archiving data as fast as possible

DevFeed: [Archiving data as fast as possible](<https://devfeed.tech/articles/archiving-data-as-fast-as-possible-34504.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2013/07/archiving-data-as-fast-as-possible/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2013-07-05T13:30:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Database](<https://devfeed.tech/topics/database.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Common Lisp](<https://devfeed.tech/topics/common-lisp.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [lisp](<https://devfeed.tech/tags/lisp.md>), [pgq](<https://devfeed.tech/tags/pgq.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [replication](<https://devfeed.tech/tags/replication.md>), [standby](<https://devfeed.tech/tags/standby.md>)

## AI overview

The article describes archiving data from one PostgreSQL table to another using writable common table expressions and a single transaction. It also discusses handling foreign keys, remote archiving, and throttling the process by monitoring replication lag on a Hot Standby server.

## Source excerpt

In a recent article here we've been talking about how do do Batch Updates in a very efficient way, using the Writable CTE features available in PostgreSQL 9.1. I sometime read how Common Table Expressions changed the life of fellow DBAs and developers, and would say that Writable CTE are at least the same boost again.