Bug report
Describe the bug
pg_net isn't casting interval values properly. The pg_net.ttl GUC is used in the following function:
uint64 delete_expired_responses(char *ttl, int batch_size) {
if (del_response_plan == NULL) {
SPIPlanPtr tmp = SPI_prepare("\
WITH\
rows AS (\
SELECT ctid\
FROM net._http_response\
WHERE created < now() - $1\
ORDER BY created\
LIMIT $2\
)\
DELETE FROM net._http_response r\
USING rows WHERE r.ctid = rows.ctid",
2, (Oid[]){INTERVALOID, INT4OID});
When the pg_net.ttl variable is customized to something like:
ALTER SYSTEM SET pg_net.ttl = '1 minute 10 seconds';
SELECT net.worker_restart();
And then a new request is made:
SELECT net.http_get (
'https://postman-echo.com/get?foo1=bar1&foo2=bar2'
) AS request_id;
The response table is not cleaned at the new interval.
To Reproduce
Run:
ALTER SYSTEM SET pg_net.ttl = '1 minute 10 seconds';
SELECT net.worker_restart();
Make a new request:
SELECT net.http_get (
'https://postman-echo.com/get?foo1=bar1&foo2=bar2'
) AS request_id;
Wait 70s to see if it has cleared.
Expected behavior
New pg_net.ttl interval values should work as long as they follow proper PG formatting.
System information
- PG_NET: 0.20.3
- Supabase PG: 17.6.1.141
Bug report
Describe the bug
pg_net isn't casting interval values properly. The
pg_net.ttlGUC is used in the following function:When the
pg_net.ttlvariable is customized to something like:And then a new request is made:
The response table is not cleaned at the new interval.
To Reproduce
Run:
Make a new request:
Wait 70s to see if it has cleared.
Expected behavior
New
pg_net.ttlinterval values should work as long as they follow proper PG formatting.System information