[BUG?] SET TIME ZONE doesn't work with abbreviations

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [BUG?] SET TIME ZONE doesn't work with abbreviations
Date: 2021-09-07 07:43:56
Message-ID: CAJ7c6TOTK9WY2Qgn31khoRWmZfLkr=nZwds4EBhTmOuiHaZWTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I noticed that `SET TIME ZONE` / `SET timezone TO` don't work with
abbreviations:

```
# select * from pg_timezone_names where abbrev = 'MSK';
name | abbrev | utc_offset | is_dst
-------------------+--------+------------+--------
Europe/Moscow | MSK | 03:00:00 | f
Europe/Simferopol | MSK | 03:00:00 | f
W-SU | MSK | 03:00:00 | f

97394 (master) =# set time zone 'Europe/Moscow';
SET

97394 (master) =# set time zone 'MSK';
ERROR: invalid value for parameter "TimeZone": "MSK"
```

However, I can use both Europe/Moscow and MSK in timestamptz_in():

```
# select '2021-09-07 12:34:56 Europe/Moscow' :: timestamptz;
timestamptz
------------------------
2021-09-07 12:34:56+03

# select '2021-09-07 12:34:56 MSK' :: timestamptz;
timestamptz
------------------------
2021-09-07 12:34:56+03
```

PostgreSQL was built on MacOS Catalina without the `--with-system-tzdata=` flag.

Is it a bug or this behavior is intentional (something to do with SQL
standard, perhaps)?

--
Best regards,
Aleksander Alekseev

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-09-07 08:03:06 Re: Possible missing segments in archiving on standby
Previous Message tanghy.fnst@fujitsu.com 2021-09-07 07:35:17 RE: [BUG] Unexpected action when publishing partition tables