Reputation: 2076
I see Cloud SQL - MySQL has a Database Flag to set the default_time_zone. I cannot however, find how to do the same for Cloud SQL - PostgreSQL. I need my time zone to be UTC.
Upvotes: 1
Views: 4525
Reputation: 2805
The flags that you see in Cloud SQL - MySQL
in Configuring Database Flags documentation are provided by MySQL
. If you click on the flag default_time_zone
that you are referring to, then you will see that you will be redirected to MySQL documentation page. For the Cloud SQL - PostgreSQL
the flags that you see in the Configuring Database Flags documentation, are provided by PostgreSQL
, therefore they don't expose this flag or any similar flag like this.
To change the timezone of the PostgreSQL
instance, you have to SSH into it and do it by executing query:
SQL
page on the console and find your PostgreSQL
instance.Connect VM
. On the right side of your window you will see a tutorial.Compute Engine VM Instance
that will be connecting to your PostgreSQL
.Compute Engine
page and SSH to the instance that you created for connecting to the PostgreSQL
.psql "sslmode=disable dbname=postgres user=postgres hostaddr=[POSTGRESQL_PUBLIC_IP]"
to connect to the instance.SELECT NOW();
to see the current timezone, that your PostgreSQL
is running at.SET timezone to 'UTC';
to set the timezone of the PostgreSQL
to UTC
.SELECT NOW();
to verify that the default timezone server updated successfully. You can also connect to the PostgreSQL
from Cloud Shell and skip the part of the VM Instance
creation.
Upvotes: 2