You can use the options
connection parameter, as explained here:
Specify 'options' connection initialization parameter.
The value of this property may contain spaces or other special characters, and it should be properly encoded if provided in the connection URL. Spaces are considered to separate command-line arguments, unless escaped with a backslash (\
); \\
represents a literal backslash.
So that should look like
options=-c%20enable_nestloop%3Doff
But I share the horse's concern that this may be a bad idea, and you should rather tune your queries.
set enable_nestloop to false
before executing the query, and setting it back totrue
before returning the connection to the pool. Far preferably to enabling it for everything!