You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/postgresql/flexible-server/concepts-extensions.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ Azure Database for PostgreSQL flexible server instance supports a subset of key
121
121
122
122
The following extensions are available in Azure Database for PostgreSQL flexible server:
123
123
> [!NOTE]
124
-
> Extensions in the following table with the :heavy_check_mark: mark, require their corresponding libraries to be enabled in the shared_preload_libraries server parameter.
124
+
> Extensions in the following table with the :heavy_check_mark: mark, require their corresponding libraries to be enabled in the `shared_preload_libraries` server parameter.
@@ -133,73 +133,73 @@ We recommend deploying your servers with [virtual network integration](concepts-
133
133
134
134
## pg_prewarm
135
135
136
-
The pg_prewarm extension loads relational data into cache. Prewarming your caches means that your queries have better response times on their first run after a restart. The auto-prewarm functionality isn't currently available in Azure Database for PostgreSQL flexible server.
136
+
The `pg_prewarm` extension loads relational data into cache. Prewarming your caches means that your queries have better response times on their first run after a restart. The auto-prewarm functionality isn't currently available in Azure Database for PostgreSQL flexible server.
137
137
138
138
## pg_cron
139
139
140
-
[pg_cron](https://github.com/citusdata/pg_cron/) is a simple, cron-based job scheduler for PostgreSQL that runs inside the database as an extension. The pg_cron extension can be used to run scheduled maintenance tasks within a PostgreSQL database. For example, you can run periodic vacuum of a table or removing old data jobs.
140
+
[pg_cron](https://github.com/citusdata/pg_cron/) is a simple, cron-based job scheduler for PostgreSQL that runs inside the database as an extension. The `pg_cron` extension can be used to run scheduled maintenance tasks within a PostgreSQL database. For example, you can run periodic vacuum of a table or removing old data jobs.
141
141
142
142
`pg_cron` can run multiple jobs in parallel, but it runs at most one instance of a job at a time. If a second run is supposed to start before the first one finishes, then the second run is queued and started as soon as the first run completes. This ensures that jobs run exactly as many times as scheduled and don't run concurrently with themselves.
143
143
144
144
Some examples:
145
145
146
-
To delete old data on Saturday at 3:30am (GMT)
146
+
To delete old data on Saturday at 3:30am (GMT).
147
147
148
148
```
149
149
SELECT cron.schedule('30 3 * * 6', $$DELETE FROM events WHERE event_time < now() - interval '1 week'$$);
150
150
```
151
-
To run vacuum every day at 10:00am (GMT) in default database 'postgres'
151
+
To run vacuum every day at 10:00am (GMT) in default database `postgres`.
152
152
153
153
154
154
```
155
155
SELECT cron.schedule('0 10 * * *', 'VACUUM');
156
156
```
157
157
158
-
To unschedule all tasks from pg_cron
158
+
To unschedule all tasks from `pg_cron`.
159
159
160
160
```
161
161
SELECT cron.unschedule(jobid) FROM cron.job;
162
162
```
163
-
To see all jobs currently scheduled with pg_cron
163
+
To see all jobs currently scheduled with `pg_cron`.
164
164
165
165
166
166
```
167
167
SELECT * FROM cron.job;
168
168
```
169
-
To run vacuum every day at 10:00 am (GMT) in database 'testcron' under azure_pg_admin role account
169
+
To run vacuum every day at 10:00 am (GMT) in database 'testcron' under azure_pg_admin role account.
> pg_cron extension is preloaded in shared_preload_libraries for every Azure Database for PostgreSQL flexible server instance inside postgres database to provide you with ability to schedule jobs to run in other databases within your Azure Database for PostgreSQL flexible server DB instance without compromising security. However, for security reasons, you still have to [allow list](#how-to-use-postgresql-extensions) pg_cron extension and install it using [CREATE EXTENSION](https://www.postgresql.org/docs/current/sql-createextension.html) command.
177
+
> pg_cron extension is preloaded in `shared_preload_libraries` for every Azure Database for PostgreSQL flexible server instance inside postgres database to provide you with ability to schedule jobs to run in other databases within your Azure Database for PostgreSQL flexible server DB instance without compromising security. However, for security reasons, you still have to [allow list](#how-to-use-postgresql-extensions)`pg_cron` extension and install it using [CREATE EXTENSION](https://www.postgresql.org/docs/current/sql-createextension.html) command.
178
178
179
-
Starting with pg_cron version 1.4, you can use the cron.schedule_in_database and cron.alter_job functions to schedule your job in a specific database and update an existing schedule respectively.
179
+
Starting with `pg_cron` version 1.4, you can use the `cron.schedule_in_database` and `cron.alter_job` functions to schedule your job in a specific database and update an existing schedule respectively.
180
180
181
181
Some examples:
182
182
183
-
To delete old data on Saturday at 3:30am (GMT) on database DBName
183
+
To delete old data on Saturday at 3:30am (GMT) on database DBName.
184
184
185
185
```
186
186
SELECT cron.schedule_in_database('JobName', '30 3 * * 6', $$DELETE FROM events WHERE event_time < now() - interval '1 week'$$,'DBName');
187
187
```
188
188
> [!NOTE]
189
-
> cron_schedule_in_database function allows for user name as optional parameter. Setting the username to a non-null value requires PostgreSQL superuser privilege and is not supported in Azure Database for PostgreSQL flexible server. Preceding examples show running this function with optional user name parameter ommitted or set to null, which runs the job in context of user scheduling the job, which should have azure_pg_admin role privileges.
189
+
> `cron_schedule_in_database` function allows for user name as optional parameter. Setting the username to a non-null value requires PostgreSQL superuser privilege and is not supported in Azure Database for PostgreSQL flexible server. Preceding examples show running this function with optional user name parameter ommitted or set to null, which runs the job in context of user scheduling the job, which should have azure_pg_admin role privileges.
190
190
191
191
To update or change the database name for the existing schedule
The PG Failover Slots extension enhances Azure Database for PostgreSQL flexible server when operating with both logical replication and high availability enabled servers. It effectively addresses the challenge within the standard PostgreSQL engine that doesn't preserve logical replication slots after a failover. Maintaining these slots is critical to prevent replication pauses or data mismatches during primary server role changes, ensuring operational continuity and data integrity.
200
200
201
201
The extension streamlines the failover process by managing the necessary transfer, cleanup, and synchronization of replication slots, thus providing a seamless transition during server role changes.
202
-
The extension is supported for PostgreSQL versions 16 to 11.
202
+
The extension is supported for PostgreSQL versions 11 to 16.
203
203
204
204
You can find more information and how to use the PG Failover Slots extension on its [GitHub page](https://github.com/EnterpriseDB/pg_failover_slots).
205
205
@@ -226,11 +226,11 @@ By selecting **Save and restart**, your server will automatically reboot, applyi
226
226
227
227
The [pg_stat_statements extension](https://www.postgresql.org/docs/current/pgstatstatements.html) gives you a view of all the queries that have run on your database. That is useful to get an understanding of what your query workload performance looks like on a production system.
228
228
229
-
The [pg_stat_statements extension](https://www.postgresql.org/docs/current/pgstatstatements.html) is preloaded in shared_preload_libraries on every Azure Database for PostgreSQL flexible server instance to provide you a means of tracking execution statistics of SQL statements.
229
+
The [pg_stat_statements extension](https://www.postgresql.org/docs/current/pgstatstatements.html) is preloaded in `shared_preload_libraries` on every Azure Database for PostgreSQL flexible server instance to provide you a means of tracking execution statistics of SQL statements.
230
230
However, for security reasons, you still have to [allowlist](#how-to-use-postgresql-extensions)[pg_stat_statements extension](https://www.postgresql.org/docs/current/pgstatstatements.html) and install it using [CREATE EXTENSION](https://www.postgresql.org/docs/current/sql-createextension.html) command.
231
231
The setting `pg_stat_statements.track`, which controls what statements are counted by the extension, defaults to `top`, meaning all statements issued directly by clients are tracked. The two other tracking levels are `none` and `all`. This setting is configurable as a server parameter.
232
232
233
-
There's a tradeoff between the query execution information pg_stat_statements provides and the impact on server performance as it logs each SQL statement. If you aren't actively using the pg_stat_statements extension, we recommend that you set `pg_stat_statements.track` to `none`. Some third-party monitoring services might rely on pg_stat_statements to deliver query performance insights, so confirm whether this is the case for you or not.
233
+
There's a tradeoff between the query execution information `pg_stat_statements` provides and the impact on server performance as it logs each SQL statement. If you aren't actively using the `pg_stat_statements` extension, we recommend that you set `pg_stat_statements.track` to `none`. Some third-party monitoring services might rely on `pg_stat_statements` to deliver query performance insights, so confirm whether this is the case for you or not.
234
234
235
235
## TimescaleDB
236
236
@@ -283,7 +283,7 @@ Now you can run pg_dump on the original database and then do pg_restore. After t
283
283
```SQL
284
284
SELECT timescaledb_post_restore();
285
285
```
286
-
For more details on restore method with Timescale enabled database, see [Timescale documentation](https://docs.timescale.com/timescaledb/latest/how-to-guides/backup-and-restore/pg-dump-and-restore/#restore-your-entire-database-from-backup)
286
+
For more details on restore method with Timescale enabled database, see [Timescale documentation](https://docs.timescale.com/timescaledb/latest/how-to-guides/backup-and-restore/pg-dump-and-restore/#restore-your-entire-database-from-backup).
287
287
288
288
289
289
### Restore a Timescale database using timescaledb-backup
@@ -302,7 +302,7 @@ More details on these utilities can be found [here](https://github.com/timescale
302
302
303
303
## pg_hint_plan
304
304
305
-
`pg_hint_plan` makes it possible to tweak PostgreSQL execution plans using so-called "hints" in SQL comments, like
305
+
`pg_hint_plan` makes it possible to tweak PostgreSQL execution plans using so-called "hints" in SQL comments, like:
306
306
307
307
```sql
308
308
/*+ SeqScan(a) */
@@ -341,12 +341,12 @@ Using the [Azure portal](https://portal.azure.com/):
341
341
You can now enable pg_hint_plan your Azure Database for PostgreSQL flexible server database. Connect to the database and issue the following command:
342
342
343
343
```sql
344
-
CREATE EXTENSION pg_hint_plan ;
344
+
CREATE EXTENSION pg_hint_plan ;
345
345
```
346
346
347
347
## pg_buffercache
348
348
349
-
`Pg_buffercache` can be used to study the contents of *shared_buffers*. Using [this extension](https://www.postgresql.org/docs/current/pgbuffercache.html) you can tell if a particular relation is cached or not(in *shared_buffers*). This extension can help you in troubleshooting performance issues (caching related performance issues)
349
+
`Pg_buffercache` can be used to study the contents of *shared_buffers*. Using [this extension](https://www.postgresql.org/docs/current/pgbuffercache.html) you can tell if a particular relation is cached or not(in `shared_buffers`). This extension can help you troubleshooting performance issues (caching related performance issues).
350
350
351
351
This is part of contrib, and it's easy to install this extension.
0 commit comments