Skip to content

Is it possible to translate PostgREST queries to SQL inside of Postgres? #3817

Closed Answered by wolfgangwalther
ChuckJonas asked this question in Q&A
Discussion options

You must be logged in to vote

Does postgREST expose a SQL function that would allow you to translate a PostgREST query to a SQL query?

No, this translation is done via Haskell, not SQL, so we don't have a function to expose.

You could enable statement logging to see which queries PostgREST is running: https://docs.postgrest.org/en/v12/references/observability.html#database-logs

If you just want to see execution plans, you can do it like this: https://docs.postgrest.org/en/v12/references/observability.html#execution-plan

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChuckJonas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants