Skip to content

Commit 507a2cd

Browse files
authored
Merge pull request #99524 from rachel-msft/edits1220
Update concepts-extensions.md
2 parents 945258c + 73e4c41 commit 507a2cd

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

articles/postgresql/concepts-extensions.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: rachel-msft
55
ms.author: raagyema
66
ms.service: postgresql
77
ms.topic: conceptual
8-
ms.date: 12/03/2019
8+
ms.date: 12/20/2019
99
---
1010
# PostgreSQL extensions in Azure Database for PostgreSQL - Single Server
1111
PostgreSQL provides the ability to extend the functionality of your database using extensions. Extensions bundle multiple related SQL objects together in a single package that can be loaded or removed from your database with a single command. After being loaded in the database, extensions function like built-in features.
@@ -247,6 +247,26 @@ CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
247247
248248
You can now create a TimescaleDB hypertable [from scratch](https://docs.timescale.com/getting-started/creating-hypertables) or migrate [existing time-series data in PostgreSQL](https://docs.timescale.com/getting-started/migrating-data).
249249

250+
### Restoring a Timescale database
251+
To restore a Timescale database using pg_dump and pg_restore, you need to run two helper procedures in the destination database: `timescaledb_pre_restore()` and `timescaledb_post restore()`.
252+
253+
First prepare the destination database:
254+
255+
```SQL
256+
--create the new database where you'll perform the restore
257+
CREATE DATABASE tutorial;
258+
\c tutorial --connect to the database
259+
CREATE EXTENSION timescaledb;
260+
261+
SELECT timescaledb_pre_restore();
262+
```
263+
264+
Now you can run pg_dump on the original database and then do pg_restore. After the restore, be sure to run the following command in the restored database:
265+
266+
```SQL
267+
SELECT timescaledb_post_restore();
268+
```
269+
250270

251271
## Next steps
252272
If you don't see an extension that you'd like to use, let us know. Vote for existing requests or create new feedback requests in our [feedback forum](https://feedback.azure.com/forums/597976-azure-database-for-postgresql).

0 commit comments

Comments
 (0)