Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong subquery returns as 400 Bad Request #3205

Closed
steve-chavez opened this issue Feb 3, 2024 · 0 comments · Fixed by #3206
Closed

Wrong subquery returns as 400 Bad Request #3205

steve-chavez opened this issue Feb 3, 2024 · 0 comments · Fixed by #3206
Labels

Comments

@steve-chavez
Copy link
Member

Problem

Having a wrong view/function like:

create view bad_subquery as
select * from projects where id = (select id from projects);

postgres=# \set VERBOSITY verbose 
postgres=# select * from bad_subquery ;
ERROR:  21000: more than one row returned by a subquery used as an expression
LOCATION:  ExecSetParamPlan, nodeSubplan.c:1172

Returns a 400 Bad Request when invoked through postgREST:

$ curl localhost:3000/bad_subquery -i
HTTP/1.1 400 Bad Request

Solution

It should return 500 Internal Server Error.

@steve-chavez steve-chavez changed the title Wrong subquery returned as 400 Bad Request Wrong subquery returns as 400 Bad Request Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant