fix: fix incorrect 413 error on pg 54* errors
This commit is contained in:
committed by
Steve Chavez
parent
11c9e8dac9
commit
5cc32c7f87
@@ -67,3 +67,15 @@ pgErrorCodeMapping = do
|
||||
describe "PostreSQL error code mappings" $ do
|
||||
it "should return 500 for cardinality_violation" $
|
||||
get "/bad_subquery" `shouldRespondWith` 500
|
||||
|
||||
it "should return 500 for statement too complex" $
|
||||
request methodPost "/infinite_inserts"
|
||||
[]
|
||||
[json|{"id": 3, "name": "qwer"}|]
|
||||
`shouldRespondWith`
|
||||
[json|
|
||||
{"code": "54001",
|
||||
"details": null,
|
||||
"hint": "Increase the configuration parameter \"max_stack_depth\" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.",
|
||||
"message": "stack depth limit exceeded"}|]
|
||||
{ matchStatus = 500 }
|
||||
|
||||
Vendored
+17
@@ -3777,3 +3777,20 @@ 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';
|
||||
|
||||
-- https://github.com/PostgREST/postgrest/issues/3255
|
||||
create table test.infinite_inserts(
|
||||
id int
|
||||
, name text
|
||||
);
|
||||
|
||||
create or replace function infinite_inserts()
|
||||
returns trigger as $$ begin
|
||||
insert into infinite_inserts values (NEW.id, NEW.name);
|
||||
end $$ language plpgsql;
|
||||
|
||||
create trigger do_infinite_inserts
|
||||
after insert
|
||||
on infinite_inserts
|
||||
for each row
|
||||
execute procedure infinite_inserts();
|
||||
|
||||
Reference in New Issue
Block a user