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 1tzVBD-002r4i-DI for pgsql-general@arkaria.postgresql.org; Tue, 01 Apr 2025 06:32:59 +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 1tzVBB-00Glb1-R1 for pgsql-general@arkaria.postgresql.org; Tue, 01 Apr 2025 06:32:57 +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 1tzVBB-00Glat-Fo for pgsql-general@lists.postgresql.org; Tue, 01 Apr 2025 06:32:57 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzVB9-002HT7-2B for pgsql-general@postgresql.org; Tue, 01 Apr 2025 06:32:56 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7c5e2fe5f17so511228685a.3 for ; Mon, 31 Mar 2025 23:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743489174; x=1744093974; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mVLLVUYs3ATeQZqFV0tC4SZ4T4xHdnbwKU4OvzeaBYo=; b=KGXxlb/5StVXDJeuF/YFO6Vb5tDxlOwCt7Rx9NsaCPUpEzpU540dNLm5kiGnKh3Lah OHFTIjwibi93QycldISizOPaUZHh41VK8zO6eaXxvjxbjDq/xTSK8aKOtUEb6k+KfLyE 49SaECBiwoRWDy7b9ys+0d2Pa8BfDmYO1Czw5vbmJnLHJ7ZwixpOL88FqU8UyVZlLjpF R7g0vKpWIGcec7NImfcaHyFHTcShFfDWB6NnD0pr8BHTZj39hCslqGDWcW3ZnIbAHVC2 g1nxJrHrKgxulXn14AZOlBAYuSCSAYEHq70XCtC1gmxn6z9p8h22NkUBwmlMfKES8psp 6Jlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743489174; x=1744093974; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mVLLVUYs3ATeQZqFV0tC4SZ4T4xHdnbwKU4OvzeaBYo=; b=dZzfF6IKurDzvZg53qy1Vihe8e3eF9kpHqL3CYhqkc1vUjeMH0JM6iIeHpRr22hXWG nxfbRCJHQOYzzlNtVooVJWVdqZ/kkzPVpXVRHng6/VVfblJDU7aLhMmWNTn4qjWK2kew AXAeTWTGHI8DrMHkm+m1hCwTNJf3/x7CpUnwn/+Zw24coKS3ly4VLciWFN6hEy20F/cV F9KpVMrJzA120q4qAqMq5lVdjit/Qs3xfdtkCck8OBk14JQrV/vpSn+Qi/68r7MAkm0n 3nR0zoLAjURRGnzMa8usIF2c6LP6n2S0XyTsog3MUNYB08TPSIRnd6+V9focX7gX6pLW Ydeg== X-Gm-Message-State: AOJu0YyyBr4gcsp8asrId1WatRIEWyBW7WkeB0PdzgDQWM05EOVEVROG PURnser9LjcFkskYPUuXN3TeXEWmF8yfTkU3WtYZ0qGasWh/R3fZexm0tPYnDMe56nYfI4XoJIs pYAEGXIvC4FE5tEaYlPTEqDg66no= X-Gm-Gg: ASbGnctfypEsBv71E15XXlp67kNm+FyAyzhTmNAbvhtHiIJvBJFgWL+I/ry664TcRX9 rNwWvTmiv9WVtE7GXzX4+N8fTONxKBVEOnmSzydWZIfq/SpeSCCMR8m/iQH/jIv41h9SY7aRYXS eX6ldFybXGfSaCDRyEdoUQcjscVvg6DxjKn0Ugfw== X-Google-Smtp-Source: AGHT+IH5EiRfLDvsDgWXpSyYphGa0eEPNL5KCrd3DU09pl8ObZrB6jvAInr3rpq3H3g3fQTpgJqsW78B8Y3raihsk2I= X-Received: by 2002:a05:620a:440f:b0:7c5:4de8:bf71 with SMTP id af79cd13be357-7c690892b51mr1934274185a.50.1743489174372; Mon, 31 Mar 2025 23:32:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jayadevan M Date: Tue, 1 Apr 2025 12:02:43 +0530 X-Gm-Features: AQ5f1Jpq0BIfGeQwBRqhTOfVxoXZORLvg1FV6iQI6RiNGbSv7fwxTi4c7PvS_CQ Message-ID: Subject: Re: Doubt on pg_timezone_names and pg_timezone_abbrevs To: "David G. Johnston" Cc: "pgsql-general@postgresql.org" Content-Type: multipart/alternative; boundary="000000000000e8858a0631b1b4ab" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e8858a0631b1b4ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 1, 2025 at 9:28=E2=80=AFAM David G. Johnston wrote: > On Mon, Mar 31, 2025 at 8:39=E2=80=AFPM Jayadevan M > wrote: > >> Hello PG members, >> I used 'IST' in a query like this - * (timestamp_hour) at time zone >> 'IST' time_ist *and did not get the expected output - timestamp in >> Indian Standard Time. So I queried the 2 views that provide timezone inf= o >> and did not really understand the abbrev column. >> select name, abbrev, utc_offset from pg_timezone_names where abbrev = =3D >> 'IST' ; >> > > Since the S and T are non-location specific you get 26 different timezone > abbreviations to choose from. That wasn't enough for the world. So IST i= s > non-unique; and for historical reasons Ireland (Eire, which contains > Dublin) is given default priority. > > >> name | abbrev | utc_offset >> ---------------+--------+------------ >> Eire | IST | 01:00:00 >> Asia/Kolkata | IST | 05:30:00 >> Asia/Calcutta | IST | 05:30:00 >> Europe/Dublin | IST | 01:00:00 >> > > Suggest you adapt to using ISO names (the name column above) for > timezones; which are long enough and location-specific enough to be > unique. In your case, pick your preferred spelling of Calcutta I suppose= . > > Thank you. I used Calcutta. Regards, Jayadevan --000000000000e8858a0631b1b4ab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Apr 1, = 2025 at 9:28=E2=80=AFAM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Mon, Mar 31, 2025 at 8:39=E2=80=AFPM= Jayadevan M <maymala.jayadevan@gmail.com> wrote:
Hello PG members,
I used 'IST'=C2=A0 in a query lik= e this -=C2=A0=C2=A0(timestamp_hour) at time zone 'IST' time_= ist and did not get the expected output - timestamp in Indian Stand= ard Time. So I queried the 2 views that provide timezone info and did not r= eally understand the abbrev column.=C2=A0
select name, abbrev, ut= c_offset =C2=A0from pg_timezone_names =C2=A0where abbrev =3D 'IST' = =C2=A0;

Since the S and T are non-location speci= fic you get 26 different timezone abbreviations to choose from. That wasn&#= 39;t enough for the world.=C2=A0 So IST is non-unique; and for historical r= easons Ireland (Eire, which contains Dublin) is given default priority.
=C2=A0
=
=C2=A0 =C2=A0 =C2=A0name =C2=A0 =C2=A0 =C2=A0| abbrev= | utc_offset
---------------+--------+------------
=C2=A0Eire =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| IST =C2=A0 =C2=A0| 01:00:00
=C2=A0Asia/= Kolkata =C2=A0| IST =C2=A0 =C2=A0| 05:30:00
=C2=A0Asia/Calcutta | IST = =C2=A0 =C2=A0| 05:30:00
=C2=A0Europe/Dublin | IST =C2=A0 =C2=A0| 01:00:0= 0

Suggest you adapt to using ISO names (the name colu= mn above) for timezones; which are long enough and location-specific enough= to be unique.=C2=A0 In your case, pick your preferred spelling of Calcutta= I suppose.

=
Thank you. I used Calcutta.
R= egards,
Jayadevan=C2=A0
--000000000000e8858a0631b1b4ab--