How to add Indian timezone to Postgresql?

可紊 提交于 2019-12-10 23:18:16

问题


i'm trying to find out what's the easiest way to add India Standard Time (+0530 from utc) to postgresql (9.1).

i tried the silly thing of trying to insert it into the table, but it doesn't work.

insert into pg_timezone_abbrevs values('INDIA','05:30:00');

the problem what detected years ago by other people, Googling in old mailing lists tells me. but not simple solution found.


回答1:


Buttom line: don't use IST, that's Israel time zone, not Indian time zone. use 'Asia/Kolkata'. instead.

Postgres documentation of this is vague, but notice that looking at:

SELECT name, abbrev, utc_offset, is_dst FROM pg_timezone_names;

will give you different options that those of, not showing all the available timezones.

SELECT abbrev, utc_offset, is_dst FROM pg_timezone_abbrevs;

and editing this file doesn't have any effect. don't bother. perhaps you need to manually change another config to include it.

/usr/share/postgresql/9.1/timezonesets/Asia.txt



来源:https://stackoverflow.com/questions/15689650/how-to-add-indian-timezone-to-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!