We are trying to implement the PostgreSQL JDBC driver protocol by creating a service that acts as a PostgreSQL database. Our customers are expected to use standard PostgreSQL clients, so we have no control over that. We can only control the backend implementation.
What I'm trying to do now is to send the LIMIT and OFFSET values using the JDBC API, and NOT within the query.
Sending the FETCH value can be done using the setMaxRows method but I can't find a way to send the OFFSET value.
I tried setting parameters to a prepared statement but the client threw an exception because no parameters where found in the prepared query. Which is expected.
So is there a way to send a parameter\attribute along with a query so the backend can read this parameter ? The parameter need to be query-scoped, meaning that it should only exist during a single specific execution.