Skip to content

Commit 0364cd6

Browse files
polishing
1 parent 11e70bc commit 0364cd6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

articles/postgresql/flexible-server/concepts-extensions.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Using [Azure CLI](/cli/azure/):
3131

3232
You can allowlist extensions via CLI parameter set [command](/cli/azure/postgres/flexible-server/parameter?view=azure-cli-latest&preserve-view=true).
3333

34-
```bash
34+
```azurecli
3535
az postgres flexible-server parameter set --resource-group <your resource group> --server-name <your server name> --subscription <your subscription id> --name azure.extensions --value <extension name>,<extension name>
3636
```
3737

@@ -106,7 +106,7 @@ Using [Azure CLI](/cli/azure/):
106106

107107
You can set `shared_preload_libraries` via CLI parameter set [command](/cli/azure/postgres/flexible-server/parameter?view=azure-cli-latest&preserve-view=true).
108108

109-
```bash
109+
```azurecli
110110
az postgres flexible-server parameter set --resource-group <your resource group> --server-name <your server name> --subscription <your subscription id> --name shared_preload_libraries --value <extension name>,<extension name>
111111
```
112112

@@ -145,31 +145,31 @@ Some examples:
145145

146146
To delete old data on Saturday at 3:30am (GMT).
147147

148-
```
148+
```sql
149149
SELECT cron.schedule('30 3 * * 6', $$DELETE FROM events WHERE event_time < now() - interval '1 week'$$);
150150
```
151151
To run vacuum every day at 10:00am (GMT) in default database `postgres`.
152152

153153

154-
```
154+
```sql
155155
SELECT cron.schedule('0 10 * * *', 'VACUUM');
156156
```
157157

158158
To unschedule all tasks from `pg_cron`.
159159

160-
```
160+
```sql
161161
SELECT cron.unschedule(jobid) FROM cron.job;
162162
```
163163
To see all jobs currently scheduled with `pg_cron`.
164164

165165

166-
```
166+
```sql
167167
SELECT * FROM cron.job;
168168
```
169169
To run vacuum every day at 10:00 am (GMT) in database 'testcron' under azure_pg_admin role account.
170170

171171

172-
```
172+
```sql
173173
SELECT cron.schedule_in_database('VACUUM','0 10 * * * ','VACUUM','testcron',null,TRUE);
174174
```
175175

@@ -182,15 +182,15 @@ Some examples:
182182

183183
To delete old data on Saturday at 3:30am (GMT) on database DBName.
184184

185-
```
185+
```sql
186186
SELECT cron.schedule_in_database('JobName', '30 3 * * 6', $$DELETE FROM events WHERE event_time < now() - interval '1 week'$$,'DBName');
187187
```
188188
> [!NOTE]
189189
> `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.
190190
191191
To update or change the database name for the existing schedule
192192

193-
```
193+
```sql
194194
SELECT cron.alter_job(job_id:=MyJobID,database:='NewDBName');
195195
```
196196

@@ -341,7 +341,7 @@ Using the [Azure portal](https://portal.azure.com/):
341341
You can now enable pg_hint_plan your Azure Database for PostgreSQL flexible server database. Connect to the database and issue the following command:
342342

343343
```sql
344-
CREATE EXTENSION pg_hint_plan ;
344+
CREATE EXTENSION pg_hint_plan;
345345
```
346346

347347
## pg_buffercache

0 commit comments

Comments
 (0)