-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix postgrest #10064
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
base: master
Are you sure you want to change the base?
Fix postgrest #10064
Conversation
I also looked at the "updates" benchmark and it should work in theory. However, your benchmark calls that endpoint as a GET, even though it modifies the resource. |
Oops, I realized the fortunes benchmark is also broken. Will add that tomorrow. |
Locally, I get a failure for "fortunes":
I'm not sure what's happening there though. |
END | ||
$$ language plpgsql volatile; | ||
create or replace function fortunes() returns "text/html" as $$ | ||
select set_config('response.headers', '[{"Content-Type": "text/html; charset=utf-8"}]', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cptwunderlich,
This line shouldn't be necessary. PostgREST will automatically set the content type to the "text/html"
domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this adds the type "text/html", but the benchmark harness expects an explicit value of "text/html; charset=UTF-8".
If you remove it, the test fails with:
FAIL for http://tfb-server:3000/rpc/fortunes
Invalid Content-Type header, found "text/html", did not match "^text/html; ?charset=(UTF|utf)-8$".
I can add a comment to clarify.
There are some oddities in this benchmark. E.g., the "updates" benchmark will never work for postgREST, bc. they use a "GET" request for that and you just get a read-only transaction for that in postgrest....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this adds the type "text/html", but the benchmark harness expects an explicit value of "text/html; charset=UTF-8".
Got it, thanks for clarifying.
the "updates" benchmark will never work for postgREST, bc. they use a "GET" request for that and you just get a read-only transaction for that in postgrest....
Yeah, that is weird on how they landed on GET for this. There are no escape hatches on PostgREST for doing a write in a GET.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the update
benchmark should just be omitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, it's not in the config.
Updating postgrest to fix broken plaintext and json routes.