문제

Can You please guide us on how we can change the time zone of the Database to UTC which is migrated from AWS which was in time zone UTC? Now the Postgres 12 is installed in Ubuntu 20 which shows (show timezone; Asia/Kolkata ). We also want to make sure all the existing data inside the database should be changed to the new timezone. Because It is creating issues for the operation team to query on DB as all other DB in the env are in UTC.

도움이 되었습니까?

해결책

You can change the parameter by editing postgresql.conf or with ALTER SYSTEM via SQL. Don't forget to reload the database.

But you should tell the application development team that they have messed up. If the application relies on a certain setting of timezone, then the application has to set that parameter itself. The parameter can be changed using the SET SQL statement.

If you don't care about time zone handling by PostgreSQL at all, you should use the data type timestamp without time zone.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top