Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSi5P-00C2mt-Qg for pgsql-jdbc@arkaria.postgresql.org; Fri, 20 Jun 2025 20:11:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSi5N-0047t7-Os for pgsql-jdbc@arkaria.postgresql.org; Fri, 20 Jun 2025 20:11:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSi5N-0047sz-Cu for pgsql-jdbc@lists.postgresql.org; Fri, 20 Jun 2025 20:11:42 +0000 Received: from pgintl.fastcrypt.com ([149.56.129.164]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uSi5M-0036sV-0G for pgsql-jdbc@lists.postgresql.org; Fri, 20 Jun 2025 20:11:40 +0000 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by pgintl.fastcrypt.com (Postfix) with ESMTPSA id C3DD420273 for ; Fri, 20 Jun 2025 16:11:38 -0400 (EDT) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-606b58241c9so3408165a12.3 for ; Fri, 20 Jun 2025 13:11:38 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWrQD0+krJUARHPwAw8j/ZoZr8od162FaIq6Q3EpwjJQS8gitmcv6p+SAkPOgfwO3Aq+8XL09DsLSNW@lists.postgresql.org X-Gm-Message-State: AOJu0YwPBfWVGsxhqVFTbXbgmiDyIT5l1ePJafj29ZrhzVZhatDV0u4y yzy1NPB4hOJqb3n9fNU3xIZsYwiJEeT3EjFqMF/jXdBi1Ioeloghf7seto1EhlghqFOBlMwRGL6 JzRHgUCqc2sxvcak62Xejyp0FBTCRJr8= X-Google-Smtp-Source: AGHT+IEMsFEcScFrrDhqidXja91h5orS8VTNt5bWWIh0wAx/bnx0NLQ3PmTjrcezJz0shFzT/zI9rN6OgzfQH0NdZbU= X-Received: by 2002:a05:6402:3509:b0:607:2d8a:9b2a with SMTP id 4fb4d7f45d1cf-60a1cf3dc50mr3484956a12.31.1750450297590; Fri, 20 Jun 2025 13:11:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Fri, 20 Jun 2025 16:11:20 -0400 X-Gmail-Original-Message-ID: X-Gm-Features: AX0GCFttZs13UdxJa1B4nfB6QUSFlIv0-ETrU4FD5OTJRyuwO3T80mWv8dCC6Rs Message-ID: Subject: Re: Unable to set guc via setProperty To: "David G. Johnston" Cc: Manav Kumar , "pgsql-jdbc@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000002f5dba0638067884" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002f5dba0638067884 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 20 Jun 2025 at 10:23, David G. Johnston wrote: > On Friday, June 20, 2025, Manav Kumar 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=3Do= ff >> 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=E2=80=99t how things work=E2=80=A6connection pr= operties are set > using set property and gucs aren=E2=80=99t 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 pass= ed >> 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=E2=80=99t care because you=E2=80=99ll be using Java clas= ses to process > dates. > Yes, we set the datestyle to be able to interpret it correctly. You can always change the datestyle to display. Dave > > --0000000000002f5dba0638067884 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, 20 Jun 2025 at 10:23, David G. Johnston <david.g.johnston@gmail.com> wrot= e:
On Friday, Ju= ne 20, 2025, Manav Kumar <mkumar@yugabyte.com> wrote:
Hi Team,
I've a doubt reg= arding passing guc variables=C2=A0in start up packet as key value pairs ins= tead of in options.=C2=A0

I'm unable=C2=A0to s= et=C2=A0jdbc:postgresql://10.150.3.175:6433/postgres?&a= mp;geqo=3Doff
m geqo to 'off'. I don't wa= nt to use "options" rather pass directly key value pairs similar = to what JDBC driver internally does. =C2=A0

=
Neither=C2=A0setProperty("geqo", "off") works in t= his case.
Can someone let me know why I can't do it?=C2=A0

Probably because that isn=E2=80= =99t how things work=E2=80=A6connection properties are set using set proper= ty and gucs aren=E2=80=99t connection properties - though there is a pass-t= hrough connection property called options that can hold a list of gucs to s= et.
David, for my elucidation are they GUC's ? T= he docs state:
"Command-line arguments f= or the backend. (This is deprecated in favor of setting individual run-time= parameters.) Spaces within this string are considered to separate argument= s, unless escaped with a backslash (\); write=C2=A0\\= =C2=A0to represent a literal backslash."=C2=A0
=C2=A0

I lea= rnt or from code, it's seen the key value pairs has higher=C2=A0precede= nce or override the guc values passed via cmdline option("options"= ;) field when both passed in start up packet.=C2=A0
That's wh= y with JDBC, even i try to set "options - DateStyle to 'Postgres,D= M'Y'" we are unable to change value as DateStyle is also passe= d as key value by driver with 'ISO' which has higher precedence.=C2= =A0=C2=A0


IIUC t= he driver must control date style to operate correctly.=C2=A0 And as a user= you shouldn=E2=80=99t care because you=E2=80=99ll be using Java classes to= process dates.

Yes, we set the dates= tyle to be able to interpret it correctly. You can always change the datest= yle to display.

Dave=C2=A0

--0000000000002f5dba0638067884--