public inbox for [email protected]
help / color / mirror / Atom feedUnable to set guc via setProperty
4+ messages / 3 participants
[nested] [flat]
* Unable to set guc via setProperty
@ 2025-06-20 12:19 Manav Kumar <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: Manav Kumar @ 2025-06-20 12:19 UTC (permalink / raw)
To: [email protected]
Hi Team,
I've a doubt regarding passing guc variables in start up packet as key
value pairs instead of in options.
I'm unable to set jdbc:postgresql://10.150.3.175:6433/postgres?&geqo=off
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?
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.
Thanks
Manav
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Unable to set guc via setProperty
@ 2025-06-20 14:22 David G. Johnston <[email protected]>
parent: Manav Kumar <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: David G. Johnston @ 2025-06-20 14:22 UTC (permalink / raw)
To: Manav Kumar <[email protected]>; +Cc: [email protected] <[email protected]>
On Friday, June 20, 2025, Manav Kumar <[email protected]> wrote:
> Hi Team,
> I've a doubt regarding passing guc variables in start up packet as key
> value pairs instead of in options.
>
> I'm unable to set jdbc:postgresql://10.150.3.175:6433/postgres?&geqo=off
> 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.
>
> 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.
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Unable to set guc via setProperty
@ 2025-06-20 20:11 Dave Cramer <[email protected]>
parent: David G. Johnston <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: Dave Cramer @ 2025-06-20 20:11 UTC (permalink / raw)
To: David G. Johnston <[email protected]>; +Cc: Manav Kumar <[email protected]>; [email protected] <[email protected]>
On Fri, 20 Jun 2025 at 10:23, David G. Johnston <[email protected]>
wrote:
> On Friday, June 20, 2025, Manav Kumar <[email protected]> wrote:
>
>> Hi Team,
>> I've a doubt regarding passing guc variables in start up packet as key
>> value pairs instead of in options.
>>
>> I'm unable to set jdbc:postgresql://10.150.3.175:6433/postgres?&geqo=off
>> 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.
Dave
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Unable to set guc via setProperty
@ 2025-06-20 21:14 David G. Johnston <[email protected]>
parent: Dave Cramer <[email protected]>
0 siblings, 0 replies; 4+ messages in thread
From: David G. Johnston @ 2025-06-20 21:14 UTC (permalink / raw)
To: Dave Cramer <[email protected]>; +Cc: Manav Kumar <[email protected]>; [email protected] <[email protected]>
On Fri, Jun 20, 2025 at 1:11 PM Dave Cramer <[email protected]>
wrote:
>
>
> On Fri, 20 Jun 2025 at 10:23, David G. Johnston <
> [email protected]> wrote:
>
>> On Friday, June 20, 2025, Manav Kumar <[email protected]> wrote:
>>
>>> Hi Team,
>>> I've a doubt regarding passing guc variables in start up packet as key
>>> value pairs instead of in options.
>>>
>>> I'm unable to set jdbc:postgresql://10.150.3.175:6433/postgres?&geqo=off
>>> 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."
>
geqo is a GUC
https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-GEQO
And to pass GUCs into the postgres server process you bundle them up into
the "options" cli argument via the "options" parameter keyword that you've
quoted.
I do not see that deprecation warning in v18 documentation.
https://www.postgresql.org/docs/devel/libpq-connect.html#LIBPQ-CONNECT-OPTIONS
While some GUCs are also connection parameters (e.g., application_name) and
thus can be used directly most GUCs are not and much get lumped into
options.
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2025-06-20 21:14 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-20 12:19 Unable to set guc via setProperty Manav Kumar <[email protected]>
2025-06-20 14:22 ` David G. Johnston <[email protected]>
2025-06-20 20:11 ` Dave Cramer <[email protected]>
2025-06-20 21:14 ` David G. Johnston <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox