Specifically, for "time zone" there is no "to" between "time zone" and the zone name but "local" is a special-case allowed option which is not one of the options for configuration parameters (local would not make sense for most configuration parameters while default usually does).
But "timezone" (no space) is a configuration parameter and *does* require the "to".
Won't work:
steve=# alter database steve set timezone local; ERROR: syntax error at or near "local" LINE 1: alter database steve set timezone local; ^ steve=# alter database steve set time zone to local; ERROR: syntax error at or near "to" LINE 1: alter database steve set time zone to local;
steve=# alter database steve set timezone 'US/Eastern'; ERROR: syntax error at or near "'US/Eastern'" LINE 1: alter database steve set timezone 'US/Eastern';
steve=# alter database steve set timezone to 'local'; ERROR: invalid value for parameter "TimeZone": "local"
Will work:
steve=# alter database steve set time zone 'US/Eastern'; ALTER DATABASE
steve=# alter database steve set time zone local; ALTER DATABASE
steve=# alter database steve set time zone default; ALTER DATABASE
steve=# alter database steve set timezone to 'US/Eastern'; ALTER DATABASE
steve=# alter database steve set timezone to default; ALTER DATABASE
2. ALTER DATABASE name SET TIMEZONE TO LOCAL generates error - my pg is 9.5.9, please do that with correct privileges, your account was not able execute it.
I know - I was just showing both the privileged and unprivileged attempts.