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 1uScdu-00AXzq-57 for pgsql-jdbc@arkaria.postgresql.org; Fri, 20 Jun 2025 14:22:58 +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 1uScdr-0020q8-0x for pgsql-jdbc@arkaria.postgresql.org; Fri, 20 Jun 2025 14:22:55 +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 1uScdq-0020pz-Q4 for pgsql-jdbc@lists.postgresql.org; Fri, 20 Jun 2025 14:22:55 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uScdp-0034N1-19 for pgsql-jdbc@lists.postgresql.org; Fri, 20 Jun 2025 14:22:54 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-6113f0cafb2so1020332eaf.1 for ; Fri, 20 Jun 2025 07:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750429373; x=1751034173; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=E8D9xPrnqNgk3W6c7PdDcWawBzIrLqTU+eAPEVFp/Pg=; b=ZILQ9B1u3yyK8ZFkRpaGYYk9MlVwNeVVMs0ycPWOghpnEJjREVkQN6cD3izwUG5qhZ djEbZ518YGnidIFH28guCnSo5Z3mTFri78vmDpa0EoW/TgkvKhg2A5LKLokeLjbUS1dA wMWLWvA2+wVGZPGFEOBZQDIwr57drOJZ4s7/bRWFEwUXWlc7OWvzijibhhpg752bpXew kzCrV9WfnYikS9eCtx2V4vCMUkSKu8F9AbKaim0UwUi7UC6eySkOupVOdyOLr/flTNyK NTA2KmHY1+PkLijY1ovCGczsnmuBo4ynZBb9IoxJAi47mURm3sp3YFtKPKOJoqPrdiru Vlug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750429373; x=1751034173; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E8D9xPrnqNgk3W6c7PdDcWawBzIrLqTU+eAPEVFp/Pg=; b=adAKvMnDyZUFy057+9q1FL4SR/hXgzUQ1JZ4xkVTucxoRTzCOeu0IUMniQyJVf+pNG +p6/hTCO/f0vx93QC8mkw+bGaRjWzL2mNMMGlymZeKTGP9wnnvW/pkVFt85ZHCbaRZ18 H9Iv5/9j32bwnx6H0C0yORqGoUgzzhdXAQRdYKlf/BIGTJ0/nqtEPEn1RsXlH2nbhJmc odtApJ+xvyNYUDHxGsqavFjq4U4Xs57ia2tbQ3Id8uvjPh75eMTiF1rpWcULBmisYkE6 tP5LGSc2BpgfVsUIiv4+pkMMeVKKdsIfFya0Ar2185JxUzhcCYOXQthr3dkrFTCQbBFs U5UQ== X-Gm-Message-State: AOJu0YzXi1lSKwL2nsNHZb3qiJANoc6RDyDPijJ98Xiek8s80mm35x8/ U5IIw/9YLvLiDshDqMWiZmsJEFvY+5nQC/a2fWQ2uqXFkbHpI4x/47HDb8EPbnJ04n3GNYhSA1s kAcWz/KpHcB/BFfox8gWpGf3Ux32IRUSM9ZGD X-Gm-Gg: ASbGncvI4kK0ZVXgN/wMXki5GvReKKJPMBOlg8G6B1R0Cc4T04umoLIXW8nLFahF8RE gS8W2EMVbIe+N2DAa4/6fxEEFm6uj82g1E4zhcJOvpq6JBRnzvqSrhT6tDT6yFRgMtbfCuwg4IY G76oJfY+xhb3QZKHVGd+X+9ElDeGmVSKgToIMK/fLIyVggNg+5V0cdT6lnBpG6eIbqnPu3iPqLa 12n X-Google-Smtp-Source: AGHT+IGXets2aBdnVxigFF8QRdNKob7k3DFCH3xCtbKKNEQ40XAvySqORs3OWUORX0LQN4KlBPaU7mRwno1qDztUtEk= X-Received: by 2002:a05:6820:2d05:b0:60e:b4eb:6093 with SMTP id 006d021491bc7-6115b9ef530mr2127735eaf.5.1750429372561; Fri, 20 Jun 2025 07:22:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:28a6:b0:5d1:1254:d2a7 with HTTP; Fri, 20 Jun 2025 07:22:51 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Fri, 20 Jun 2025 07:22:51 -0700 X-Gm-Features: AX0GCFto_QWiJ3gnex1hBtgL6-EqaA_y76zILq2aJp9guDAOrG1QajRFBvyqIR8 Message-ID: Subject: Re: Unable to set guc via setProperty To: Manav Kumar Cc: "pgsql-jdbc@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000f4bc5706380198f9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f4bc5706380198f9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=3Dof= f > 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 prop= erties are set using set property and gucs aren=E2=80=99t connection properties - though t= here 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 precedenc= e > or override the guc values passed via cmdline option("options") field whe= n > 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 passe= d > 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 classe= s to process dates. David J. --000000000000f4bc5706380198f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, June 20, 2025, Manav Kumar <mkumar@yugabyte.com> wrote:
=
Hi Team,
I've a doubt regarding passing guc variab= les=C2=A0in start up packet as key value pairs instead of in options.=C2=A0=

I'm unable=C2=A0to set=C2=A0jd= bc:postgresql://10.150.3.175:6433/postgres?&geqo=3Doff
m geqo to 'off'. I don't want to use "opti= ons" rather pass directly key value pairs similar to what JDBC driver = internally does. =C2=A0

Neither=C2=A0setProperty("geq= o", "off") works in this 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 p= roperties are set using set property and gucs aren=E2=80=99t connection pro= perties - though there is a pass-through connection property called options= that can hold a list of gucs to set.
=C2=A0

I learnt or from code,= it's seen the key value pairs has higher=C2=A0precedence or override t= he guc values passed via cmdline option("options") field when bot= h passed in start up packet.=C2=A0
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.=C2=A0=C2=A0


IIUC the driver must co= ntrol 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.=

David J.

--000000000000f4bc5706380198f9--