[BUG?] SET TIME ZONE doesn't work with abbreviations - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject [BUG?] SET TIME ZONE doesn't work with abbreviations
Date
Msg-id CAJ7c6TOTK9WY2Qgn31khoRWmZfLkr=nZwds4EBhTmOuiHaZWTA@mail.gmail.com
Whole thread Raw
Responses Re: [BUG?] SET TIME ZONE doesn't work with abbreviations
Re: [BUG?] SET TIME ZONE doesn't work with abbreviations
List 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



pgsql-hackers by date:

Previous
From: "tanghy.fnst@fujitsu.com"
Date:
Subject: RE: [BUG] Unexpected action when publishing partition tables
Next
From: Fujii Masao
Date:
Subject: Re: Possible missing segments in archiving on standby