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 1tzSm5-002Is6-7J for pgsql-general@arkaria.postgresql.org; Tue, 01 Apr 2025 03:58:53 +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 1tzSm3-00FfaK-TN for pgsql-general@arkaria.postgresql.org; Tue, 01 Apr 2025 03:58:51 +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 1tzSm3-00FfaC-ID for pgsql-general@lists.postgresql.org; Tue, 01 Apr 2025 03:58:51 +0000 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzSm1-002GI5-21 for pgsql-general@postgresql.org; Tue, 01 Apr 2025 03:58:50 +0000 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-603f54a6cb5so102146eaf.0 for ; Mon, 31 Mar 2025 20:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743479928; x=1744084728; 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=skhek6SvlFua/VYHzsnLC/2meskzxR9cTvI11sP7nNE=; b=gXprsioBgM+KM2FwvYAgUxbnoYJFtMXEPtZLI/7SrdnkEDCgRvQLQn5AKI8Cbt0s8k Dj2s4HFg7dpBoDDf9XeKCjvrzdhNzn2PPuKto8XeqLTgMdpkFYnXO2U4cDsToyKsCzGv KVBYCrQf5bURVx3kQf3ca7Tc3dr3Q4A0FnOyrG4NCNZXYGM9pC8Ca+k+eaeldByIbpwT Cc36GrRPSLHb0vdCso1pmHvF1BVgWnew6Z9a15QkavswRIFajWRIjYFPmaNLhDHh+Neg owdu73yFTIfxnbKV9ktVhzYQuvewbMRhrtE/DWZn2tHuuTUx2f85XXwS15Ko/9aig3aD RNtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743479928; x=1744084728; 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=skhek6SvlFua/VYHzsnLC/2meskzxR9cTvI11sP7nNE=; b=frTuK6IrLtVIeD/wA3/viW/liGTNpyMLi5QY5EimCz05DO5wn37EHX8A1kgdkzUFCy nAOUzWL2hRwWUhubb0gA6jVV+0ktY/J0P76vviZVUKjWc9Ybh9V0JipWBY3vs2MdW5FQ KUt6JeBQKiGENZnFnyc7a9otBWfRwkADNJebKQnahfwzGl+Yx8Vc3Os7D28Kv45vAZ3o AWWQRyhjeINOrIIgvl+az2q9c7XLzwpjufO7xb2zbK3mJfUOjcOEZy91aISFD6FWqnL1 ag12VJpFjIoHPbr4PfOgw4ncuT0V012F7OYP3HYtDcLbAmq4qU/srzVudUvDjgat/1IB Z/0A== X-Gm-Message-State: AOJu0YxlcyKqg1MIpx2/+KrxRwmmoQS5Jdu5u2xMd07b7PkvY3nxyEDy f9Cr/8l2bBeF6Cw6JPQtY9b/3tJ0AIGULRXta7a3Rmz+H2nJ0jcg1G06Yq/P3ekXJYqd+8wdRHy wd/2W8wd5c7njvAuUwbwP3mOMaBjlIjTR X-Gm-Gg: ASbGnct/27nPqGe3+ekr2tV44L5gDqXEUKVl7nQt5SdIqynPLXMbVsAY3T08z26kTqF RNBp5hcoRNgzeNGsy5pDFIuWY6Jcsurz+x30rDe/2lj6Zfjj7TJixQMq4zk/UOG9LWjK0JUamVy GzWu3NJQOhtO7sJSUosQa8PE1x X-Google-Smtp-Source: AGHT+IHO7eILVgV6XvasiY4NLRrihAIY6/sfQ8qj+yypBXfbv51JQ/2GMHkWOfmDckqUKua3RjOX6ZsaCpZOtiWs/5g= X-Received: by 2002:a05:6870:a691:b0:2b3:55b3:e38 with SMTP id 586e51a60fabf-2cc3809ccd4mr846774fac.21.1743479928130; Mon, 31 Mar 2025 20:58:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Mon, 31 Mar 2025 20:58:11 -0700 X-Gm-Features: AQ5f1JoQddFljc8El1ResqT33kyHswLrWf_sGyMxrBLwo3Ww8DEyFCE5U4XbEe4 Message-ID: Subject: Re: Doubt on pg_timezone_names and pg_timezone_abbrevs To: Jayadevan M Cc: "pgsql-general@postgresql.org" Content-Type: multipart/alternative; boundary="000000000000ca13b50631af8d22" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ca13b50631af8d22 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 info and di= d > 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 is 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. There is a way to get a different interpretation for IST to be recognized but I'd have to find it or wait for others to chime in. David J. --000000000000ca13b50631af8d22 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Mar 31, 2025 at 8:39=E2=80=AFPM Jayadevan M <maymala.jayadevan@gmail.com> wrote:
Hel= lo PG members,
I used 'IST'=C2=A0 in a query like this -=C2=A0<= b>=C2=A0(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 info and did not really understan= d the abbrev column.=C2=A0
select name, abbrev, utc_offset =C2=A0= from pg_timezone_names =C2=A0where abbrev =3D 'IST' =C2=A0;

Since the S and T are non-locat= ion specific you get 26 different timezone abbreviations to choose from. Th= at wasn't enough for the world.=C2=A0 So IST is non-unique; and for his= torical reasons Ireland (Eire, which contains Dublin) is given default prio= rity.
=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/Calcut= ta | IST =C2=A0 =C2=A0| 05:30:00
=C2=A0Europe/Dublin | IST =C2=A0 =C2=A0= | 01:00:00

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

There i= s a way to get a different interpretation for IST to be recognized but I= 9;d have to find it or wait for others to chime in.

Da= vid J.
--000000000000ca13b50631af8d22--