I use set timezone='UTC'
And I check the database ,but it's still with time +8 :
So I reopen the terminal,it still show my timezone is ROC Why is set timezone not work,Please guide me
I use set timezone='UTC'
And I check the database ,but it's still with time +8 :
So I reopen the terminal,it still show my timezone is ROC Why is set timezone not work,Please guide me
It does work, exactly as advertised.
Refer to the documentation for SET:
SET only affects the value used by the current session..
[..SESSION] Specifies that the command takes effect for the current session. (This is the default if neither SESSION nor LOCAL appears.)
Each psql
client connection establishes a new session that is terminated when the client disconnets.
See this answer for how to actually set a "server default", which may or may not be what the real goal is.