fix: request failures when work_mem is set on a role

This commit is contained in:
Laurence Isla
2026-06-03 13:45:34 -05:00
committed by Steve Chavez
parent a149405d11
commit 416a15480f
7 changed files with 47 additions and 5 deletions
+16
View File
@@ -2187,3 +2187,19 @@ def test_positive_pool_metric(defaultenv):
).group(1)
)
assert metrics >= 0
def test_work_mem_in_role_settings(defaultenv):
"Should work when setting work_mem on a role. See https://github.com/PostgREST/postgrest/issues/4955"
env = {
**defaultenv,
"PGRST_JWT_SECRET": SECRET,
}
headers = jwtauthheader({"role": "postgrest_test_work_mem"}, SECRET)
with run(env=env) as postgrest:
response = postgrest.session.post("/rpc/get_work_mem", headers=headers)
assert response.status_code == 200
assert response.text == '"3MB"'