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 1uH4Fn-00CvE0-JX for pgsql-jdbc@arkaria.postgresql.org; Mon, 19 May 2025 17:26:19 +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 1uH4Fl-00Haa2-Cr for pgsql-jdbc@arkaria.postgresql.org; Mon, 19 May 2025 17:26:17 +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 1uH4Fl-00HaZu-5I for pgsql-jdbc@lists.postgresql.org; Mon, 19 May 2025 17:26:17 +0000 Received: from pgintl.fastcrypt.com ([149.56.129.164]) by makus.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1uH4Fi-002c0F-20 for pgsql-jdbc@lists.postgresql.org; Mon, 19 May 2025 17:26:16 +0000 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by pgintl.fastcrypt.com (Postfix) with ESMTPSA id 578F220276 for ; Mon, 19 May 2025 13:26:13 -0400 (EDT) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-601ad859ec0so3926267a12.0 for ; Mon, 19 May 2025 10:26:13 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWR72/uPvTCjHRX4mnB3qe6nM15Cd9mRypBUlRmBZiQUSyCHqtbMCv0D4SZsqOH14vr+JuJoxxo9Zij@lists.postgresql.org X-Gm-Message-State: AOJu0Yw1w3vbW1Gy22Ah1FZxya7sLLOomzlc0Y8ZumlqBpMVMbIiksNo 3KlJSiRFCP7kyVtKpT+hSsbJTUVyh3dMx980aodtRipVJAHpulm3MxNPvtr2SEpWO0A7xz60ZGZ ZqAh9t2U2/G9Boj96Hl8XdUu4zqEPvE8= X-Google-Smtp-Source: AGHT+IE17csIuAaa7GtKw9rCjazoD8utcC+xohAfy5Ef2hyMT0O6YA6CMuSZQwQmZ8CaQ9BHy6hf9KjuVJ06kyz+Kzc= X-Received: by 2002:a05:6402:5113:b0:601:97da:af84 with SMTP id 4fb4d7f45d1cf-60197dab384mr9517598a12.19.1747675571986; Mon, 19 May 2025 10:26:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Mon, 19 May 2025 13:25:54 -0400 X-Gmail-Original-Message-ID: X-Gm-Features: AX0GCFvWo3bPYjdMRUFstCrU04g6PC7U5ACXPjKAxlxGsanmjjpL5KHQY9eq_Pc Message-ID: Subject: Re: Understanding DateStyle guc in startup packet To: Vladimir Sitnikov Cc: Manav Kumar , pgsql-jdbc@lists.postgresql.org, Laurenz Albe Content-Type: multipart/alternative; boundary="000000000000a6a9ea0635806d68" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a6a9ea0635806d68 Content-Type: text/plain; charset="UTF-8" On Mon, 19 May 2025 at 11:43, Vladimir Sitnikov wrote: > >Why would you want to change it? > > Applications might have their own view on the way DateStyle connection > property should be set. > It could make a difference if the app uses things like select > '03-05-2025'::date. > > Of course, it would be great if the app code could resist from casting > text to dates, however, > I think the driver should stand in the way there by enforcing a very > specific DateStyle value. > > To me, DateStyle looks like timezone, and client_encoding which we > currently enforce, yet we could do better and skip enforcing the values. > If the JDK supports all the variants then yes we could easily accomplish this. Dave --000000000000a6a9ea0635806d68 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



On Mon, 19 May 2025 at 11:43, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>Why would you want to change it?

<= div>Applications might have their own view on the way DateStyle connection = property should be set.
It could make a difference if the app use= s things like select '03-05-2025'::date.

Of cours= e, it would be great if the app code could resist from casting text to date= s, however,
I think the driver should stand in the way there by e= nforcing a very specific DateStyle value.

To me, D= ateStyle looks like timezone, and=C2=A0client_encoding which we currently e= nforce, yet we could do better and skip enforcing the values.

If the JDK supports all the variants t= hen yes we could easily accomplish this.

Dave
--000000000000a6a9ea0635806d68--