fix: fix wrong 503 Service Unavailable on pg error 53400
This commit is contained in:
committed by
Steve Chavez
parent
cabe744f01
commit
21bc48ad9a
@@ -1478,3 +1478,11 @@ spec actualPgVersion =
|
||||
"details":"DETAIL is missing in the RAISE statement",
|
||||
"hint":"DETAIL must be a JSON object with obligatory keys: 'status', 'headers' and optional key: 'status_text'."}|]
|
||||
{ matchStatus = 500 }
|
||||
|
||||
-- here JWT has the role: postgrest_test_superuser
|
||||
context "test function temp_file_limit" $
|
||||
let auth = authHeaderJWT "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicG9zdGdyZXN0X3Rlc3Rfc3VwZXJ1c2VyIiwiaWQiOiJqZG9lIn0.LQ-qx0ArBnfkwQQhIHKF5cS-lzl0gnTPI8NLoPbL5Fg" in
|
||||
it "should return http status 500" $
|
||||
request methodGet "/rpc/temp_file_limit" [auth] "" `shouldRespondWith`
|
||||
[json|{"code":"53400","message":"temporary file size exceeds temp_file_limit (1kB)","details":null,"hint":null}|]
|
||||
{ matchStatus = 500 }
|
||||
|
||||
Vendored
+3
-2
@@ -1,6 +1,7 @@
|
||||
DROP ROLE IF EXISTS postgrest_test_anonymous, postgrest_test_default_role, postgrest_test_author;
|
||||
DROP ROLE IF EXISTS postgrest_test_anonymous, postgrest_test_default_role, postgrest_test_author, postgrest_test_superuser;
|
||||
CREATE ROLE postgrest_test_anonymous;
|
||||
CREATE ROLE postgrest_test_default_role;
|
||||
CREATE ROLE postgrest_test_author;
|
||||
CREATE ROLE postgrest_test_superuser WITH SUPERUSER;
|
||||
|
||||
GRANT postgrest_test_anonymous, postgrest_test_default_role, postgrest_test_author TO :PGUSER;
|
||||
GRANT postgrest_test_anonymous, postgrest_test_default_role, postgrest_test_author, postgrest_test_superuser TO :PGUSER;
|
||||
|
||||
Vendored
+6
@@ -3771,3 +3771,9 @@ select * from test.projects;
|
||||
|
||||
create or replace view test.infinite_recursion as
|
||||
select * from test.infinite_recursion;
|
||||
|
||||
|
||||
create or replace function temp_file_limit()
|
||||
returns bigint as $$
|
||||
select COUNT(*) FROM generate_series('-infinity'::TIMESTAMP, 'epoch'::TIMESTAMP, INTERVAL '1 DAY');
|
||||
$$ language sql security definer set temp_file_limit to '1kB';
|
||||
|
||||
Reference in New Issue
Block a user