fix: fix wrong http status on pg error 42P17 infinite recursion

This commit is contained in:
Taimoor Zaeem
2024-05-09 18:56:47 +02:00
committed by Wolfgang Walther
parent 903537d39d
commit 077e4a857e
5 changed files with 18 additions and 0 deletions
+7
View File
@@ -1407,3 +1407,10 @@ spec actualPgVersion = do
{ matchStatus = 200
, matchHeaders = [matchContentTypeJson]
}
context "test infinite recursion error 42P17" $
it "return http status 500" $
get "/infinite_recursion?select=*" `shouldRespondWith`
[json|{"code":"42P17","message":"infinite recursion detected in rules for relation \"infinite_recursion\"","details":null,"hint":null}|]
{ matchStatus = 500 }
+7
View File
@@ -3768,3 +3768,10 @@ create aggregate test.outfunc_agg (anyelement) (
, stype = "pg/outfunc"
, sfunc = outfunc_trans
);
-- https://github.com/PostgREST/postgrest/issues/3256
create view test.infinite_recursion as
select * from test.projects;
create or replace view test.infinite_recursion as
select * from test.infinite_recursion;