Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#2157·postgrest

Require schema to be specified in request URL

Author: robertsosinskiCreated Feb 7, 2022Updated Sep 19, 2026
Labelsdifficulty: mediumquery-grammar

Small low-priority feature request but interested if others think this would be useful: A config flag to require the schema be specified in the request via either Accept-Profile or Content-Profile headers.

Right now, when you specify db-schema=v1,v2,v3, postgrest will automatically assume v1 if no schema is specified in the headers (as it is the first specified). I want to always require the schema be specified, perhaps via a config such as db-schema-always-required or something like that.

I think I have a workaround now, where I specify the config as db-schema=null,v1,v2,v3. This way, if the user does not specify a schema postgrest tries to find the null schema (which does not exist) and throws an error. Interested if there could be any security/performance considerations around this though.

Thanks!

Source: PostgREST/postgrest

View original on GitHubView discussion on GitHub