I have this Postgresql database that serves many applications.
I'ts configured like this:
log_timezone = 'Mexico/General'
timezone = 'Mexico/General'
A Spring boot (1.2.5.RELEASE) application now needs to store it's timestamps in UTC.
Since I can't change the database default, what I guess I would need to do is to execute SET SESSION TIME ZONE UTC;
at the beginning of each database session.
I thought of using data.sql. but it's only run once at startup, right? Later on, when the database connection pool grows or shrinks, it wouldn't be executed again, right?
I'm using HicariCP for the DB connection pooling. (com.zaxxer:HikariCP:jar:2.2.5
)
Does anybody knows how to accomplish this?
Thanks.
alter user foobar set timezone = 'UTC';
then you don't need to configure Spring at allconnectionInitSql
with the string "SESSION TIME ZONE UTC".SET configuration_parameter = ..
and further down the explanation forconfiguration_parameter