On Fri, 2025-05-23 at 14:08 +0530, Manav Kumar wrote:
> Can you also share how does DRIVER comes to know the value been set for
> DateStyle is other than "ISO". and throw an error:
> The server's DateStyle parameter was changed to Postgres, DMY. The JDBC driver requires DateStyle to begin with ISO
forcorrect operation.
>
> I thought it used to read the PARAMETER STATUS packet that it receives
> from the server. But I tried changing it connection pooler i doens't
> see the same error. Can you point me to code where this assert check
> is present.
See the method
org.postgresql.core.v3.QueryExecutorImpl.receiveParameterStatus()
https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L2886
See the PostgreSQL documentation for context:
https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-ASYNC
ParameterStatus messages will be generated whenever the active value
changes for any of the parameters the backend believes the frontend
should know about. Most commonly this occurs in response to a SET SQL
command executed by the frontend, and this case is effectively
synchronous — but it is also possible for parameter status changes
to occur because the administrator changed a configuration file and
then sent the SIGHUP signal to the server. Also, if a SET command is
rolled back, an appropriate ParameterStatus message will be generated
to report the current effective value.
Yours,
Laurenz Albe