m geqo to 'off'. I don't want to use "options" rather pass directly key value pairs similar to what JDBC driver internally does.
Neither setProperty("geqo", "off") works in this case.
Can someone let me know why I can't do it?
Probably because that isn’t how things work…connection properties are set using set property and gucs aren’t connection properties - though there is a pass-through connection property called options that can hold a list of gucs to set.
David, for my elucidation are they GUC's ? The docs state:
"Command-line arguments for the backend. (This is deprecated in favor of setting individual run-time parameters.) Spaces within this string are considered to separate arguments, unless escaped with a backslash (\); write \\ to represent a literal backslash."
I learnt or from code, it's seen the key value pairs has higher precedence or override the guc values passed via cmdline option("options") field when both passed in start up packet.
That's why with JDBC, even i try to set "options - DateStyle to 'Postgres,DM'Y'" we are unable to change value as DateStyle is also passed as key value by driver with 'ISO' which has higher precedence.
IIUC the driver must control date style to operate correctly. And as a user you shouldn’t care because you’ll be using Java classes to process dates.
Yes, we set the datestyle to be able to interpret it correctly. You can always change the datestyle to display.