In other words, PostgreSQL JDBC could leave the default at 0, but then use a default fetch size.
That's seems wrong, the Fetch Size should be correctly reported, the defaultRowFetchSize property can be changed to 100 but a call to getFetchSize() should return 100 not 0.
Based on the driver docs: "defaultRowFetchSize: Default parameter for java.sql.Statement#getFetchSize(). A value of 0 means that need fetch all rows at once"
The value of 0 should be used to fetch all rows, if we leave the default at 0 and handle internally that as 100 (and reporting it as 0) it is a wrong behavior.
My reply was purely from the perspective of the JDBC specification, not how the PostgreSQL JDBC driver currently implements it.
According to the JDBC specification:
"The methods getFetchDirection and getFetchSize return the current value of the hints. If either of these methods is called before the corresponding setter method has been called, the value returned is implementation-defined."
In other words, the default fetch size is implementation defined, furthermore the javadoc of Statement.setFetchSize implies that setting it to value 0 will revert to the default (whatever that is).
Even more of an argument to leave it returning 0 unless it is explicitly set