Bug report
Describe the bug
Both functions http_get and http_post on the pg_net extension offer a timeout parameter in milliseconds.
This parameter works (unlike mentions of it not working), and indeed the requests are halted when they take longer than this amount of time.
Since http request failure can occur for a variety of reasons, of which a timeout is one such reason, it is advantageous, and indeed the case, that a timed_out column exists in the schema of the net._http_response table.
However, and contrary to expectation, the value of this column is always null, even when the error_msg strictly states a timeout.
To Reproduce
with t as (
select random(0, 100) as t1, random(0, 100) as t2
)
select
net.http_get(
url := 'https://postman-echo.com/get',
params := '{"key1": "value", "key2": 5}'::jsonb,
timeout_milliseconds := t.t1
) as req_id_get,
net.http_post(
url := 'https://postman-echo.com/post',
body := '{"key1": "value", "key2": 5}'::jsonb,
timeout_milliseconds := t.t2
) as req_id_post from t;
This gives:
| req_id_get |
req_id_post |
| 7 |
8 |
Where net._http_response shows:
| id |
status_code |
content_type |
headers |
content |
timed_out |
error_msg |
created |
| 7 |
NULL |
NULL |
NULL |
NULL |
NULL |
Timeout of 72 ms reached ... |
2025-04-10 12:41:50.712235+02 |
| 8 |
NULL |
NULL |
NULL |
NULL |
NULL |
Timeout of 34 ms reached ... |
2025-04-10 12:41:50.712235+02 |
Expected behavior
| id |
status_code |
content_type |
headers |
content |
timed_out |
error_msg |
created |
| 7 |
NULL |
NULL |
NULL |
NULL |
TRUE |
Timeout of 72 ms reached ... |
2025-04-10 12:41:50.712235+02 |
| 8 |
NULL |
NULL |
NULL |
NULL |
TRUE |
Timeout of 34 ms reached ... |
2025-04-10 12:41:50.712235+02 |
Screenshots
NA
System information
- OS: Proxmox
- pg_net version: 0.14.0
- PostgreSQL version: 17
Additional context
I installed two triggers in pg_net tables, both on row level, before insert, for both request queue and response tables.
Bug report
Describe the bug
Both functions
http_getandhttp_poston thepg_netextension offer a timeout parameter in milliseconds.This parameter works (unlike mentions of it not working), and indeed the requests are halted when they take longer than this amount of time.
Since http request failure can occur for a variety of reasons, of which a timeout is one such reason, it is advantageous, and indeed the case, that a
timed_outcolumn exists in the schema of thenet._http_responsetable.However, and contrary to expectation, the value of this column is always null, even when the
error_msgstrictly states a timeout.To Reproduce
This gives:
Where
net._http_responseshows:Expected behavior
Screenshots
NA
System information
Additional context
I installed two triggers in
pg_nettables, both on row level, before insert, for both request queue and response tables.