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: README.md
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,32 +137,42 @@ create extension pg_net;
137
137
138
138
---
139
139
140
-
# Extension Configuration:
140
+
# Extension Configuration
141
141
142
142
the extension creates 3 configurable variables:
143
143
144
144
1.**pg_net.batch_size**_(default: 200)_: An integer that limits the max number of rows that the extension will process from _`net.http_request_queue`_ during each read
145
145
2.**pg_net.ttl**_(default: 6 hours)_: An interval that defines the max time a row in the _`net.http_response`_ will live before being deleted
146
146
3.**pg_net.database_name**_(default: 'postgres')_: A string that defines which database the extension is applied to
147
147
148
-
All these variables can be viewed with the following command:
148
+
All these variables can be viewed with the following commands:
149
149
```sql
150
-
select*from pg_settings WHERE name LIKE'pg_net%'
150
+
show pg_net.batch_size;
151
+
show pg_net.ttl;
152
+
show pg_net.database_name;
151
153
```
152
154
153
-
The postgres.conf file can be found with the following SQL command:
154
-
```sql
155
-
SHOW config_file;
155
+
You can change these by editing the `postgresql.conf` file (find it with `SHOW config_file;`) or with `ALTER SYSTEM`:
156
+
157
+
```
158
+
alter system set pg_net.ttl to '1 hour'
159
+
alter system set pg_net.batch_size to 500;
160
+
```
161
+
162
+
Then, reload the settings and restart the `pg_net` background worker with:
163
+
156
164
```
165
+
select net.worker_restart();
166
+
```
167
+
168
+
Note that doing `ALTER SYSTEM` requires SUPERUSER but on PostgreSQL >= 15, you can do:
157
169
158
-
You can change the variables by adding any of the following line to your postgres.conf file
159
170
```
160
-
pg_net.batch_size = <new integer>
161
-
pg_net.ttl = '<new ttl interval>'
162
-
pg_net.database_name = '<database name>'
171
+
grant alter system on parameter pg_net.ttl to <role>;
172
+
grant alter system on parameter pg_net.batch_size to <role>;
163
173
```
164
174
165
-
After saving the file, you can execute `SELECT pg_reload_conf()` to update _postgres.conf_ for your database. If the extension does not respond to the update, it may be necessary to restart your database.
175
+
To allow regular users to update `pg_net` settings.
0 commit comments