Repository: cockroachdb/cockroach
Pull request #143499: ui: add support for all timezones in db console
Author: login: kyle-a-wong
Labels: name: v25.2.0-prerelease
Created: 2025-03-26T15:05:01Z | Merged: 2025-04-02T17:01:25Z

Adds a new cluster setting, `ui.default_timezone` to replace `ui.display_timezone` for controlling the timezone of displayed times in db console. This new setting can be set to any valid timezone.

`ui.display_timezone` is now deprecated and will be removed in a future version.

A new upgrade has also been added to set the value of `ui.default_timezone` to the value of `ui.display_timezone` if it has been updated from the default value. This will ensure that clusters which have set the deprecated `ui.display_timezone` won't experience any regressions when db console switches from using `ui.display_timezone` to
`ui.default_timezone`.

Epic: [CRDB-43155](https://cockroachlabs.atlassian.net/browse/CRDB-43155)
Resolves: [CRDB-48225](https://cockroachlabs.atlassian.net/browse/CRDB-48225)
Release note (ui change): A new cluster setting, `ui.default_timezone`, has been added to replace the now deprecated `ui.display_timezone`. This setting has no restrictions on which timezones can set and used to render timestamps in db console. `ui.display_timezone` should no longer be used and will be removed in a future version


Diff:
diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt
index 0104862cc9c8..46efa664d49a 100644
--- a/docs/generated/settings/settings-for-tenants.txt
+++ b/docs/generated/settings/settings-for-tenants.txt
@@ -407,5 +407,6 @@ trace.snapshot.rate	duration	0s	if non-zero, interval at which background trace
 trace.span_registry.enabled	boolean	false	if set, ongoing traces can be seen at https://<ui>/#/debug/tracez	application
 trace.zipkin.collector	string		the address of a Zipkin instance to receive traces, as <host>:<port>. If no port is specified, 9411 will be used.	application
 ui.database_locality_metadata.enabled	boolean	true	if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute	application
-ui.display_timezone	enumeration	etc/utc	the timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1]	application
-version	version	1000025.1-upgrading-to-1000025.2-step-004	set the active cluster version in the format '<major>.<minor>'	application
+ui.default_timezone	string		the default timezone used to format timestamps in the ui	application
+ui.display_timezone	enumeration	etc/utc	the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the 'ui.default_timezone' setting instead. 'ui.default_timezone' takes precedence over this setting. [etc/utc = 0, america/new_york = 1]	application
+version	version	1000025.1-upgrading-to-1000025.2-step-006	set the active cluster version in the format '<major>.<minor>'	application
diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html
index b1e4970776f8..acd07c6995de 100644
--- a/docs/generated/settings/settings.html
+++ b/docs/generated/settings/settings.html
@@ -365,7 +365,8 @@
 <tr><td><div id="setting-trace-span-registry-enabled" class="anchored"><code>trace.span_registry.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>if set, ongoing traces can be seen at https://&lt;ui&gt;/#/debug/tracez</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
 <tr><td><div id="setting-trace-zipkin-collector" class="anchored"><code>trace.zipkin.collector</code></div></td><td>string</td><td><code></code></td><td>the address of a Zipkin instance to receive traces, as &lt;host&gt;:&lt;port&gt;. If no port is specified, 9411 will be used.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
 <tr><td><div id="setting-ui-database-locality-metadata-enabled" class="anchored"><code>ui.database_locality_metadata.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
-<tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1]</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
-<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.1-upgrading-to-1000025.2-step-004</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
+<tr><td><div id="setting-ui-default-timezone" class="anchored"><code>ui.default_timezone</code></div></td><td>string</td><td><code></code></td><td>the default timezone used to format timestamps in the ui</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
+<tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the &#39;ui.default_timezone&#39; setting instead. &#39;ui.default_timezone&#39; takes precedence over this setting. [etc/utc = 0, america/new_york = 1]</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
+<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.1-upgrading-to-1000025.2-step-006</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
 </tbody>
 </table>
diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go
index cb3a9e57d8e4..dd53f6423c10 100644
--- a/pkg/clusterversion/cockroach_versions.go
+++ b/pkg/clusterversion/cockroach_versions.go
@@ -227,6 +227,8 @@ const (
 
 	V25_2_AddSqlActivityFlushJob
 
+	V25_2_SetUiDefaultTimezoneSetting
+
 	// *************************************************
 	// Step (1) Add new versions above this comment.
 	// Do not add new versions to a patch release.
@@ -278,8 +280,9 @@ var versionTable = [numKeys]roachpb.Version{
 	V25_1: {Major: 25, Minor: 1, Internal: 0},
 
 	// v25.2 versions. Internal versions must be even.
-	V25_2_Start:                  {Major: 25, Minor: 1, Internal: 2},
-	V25_2_AddSqlActivityFlushJob: {Major: 25, Minor: 1, Internal: 4},
+	V25_2_Start:                       {Major: 25, Minor: 1, Internal: 2},
+	V25_2_AddSqlActivityFlushJob:      {Major: 25, Minor: 1, Internal: 4},
+	V25_2_SetUiDefaultTimezoneSetting: {Major: 25, Minor: 1, Internal: 6},
 
 	// *************************************************
 	// Step (2): Add new versions above this comment.
diff --git a/pkg/sql/catalog/bootstrap/testdata/testdata b/pkg/sql/catalog/bootstrap/testdata/testdata
index 6e253d9e652f..6deffe775e3e 100644
--- a/pkg/sql/catalog/bootstrap/testdata/testdata
+++ b/pkg/sql/catalog/bootstrap/testdata/testdata
@@ -1,7 +1,7 @@
-system hash=594e3fbde512dd058e06f2d4924d08774b8fe41d67025ccc098f0eb051990681
+system hash=7c77a643e86cfe4d034a2ffb99167fad8694f9f950cd28ba24817ff52528cee9
 ----
 [{"key":"8b"}
-,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020047000"}
+,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020067000"}
 ,{"key":"8b898b8a89","value":"030aa0030a0a64657363726970746f721803200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c08081000180030005011600020013000680070007800800100880100980100480352740a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
 ,{"key":"8b898c8a89","value":"030adc050a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018003000501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018003000501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c08001000180030005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055293010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f6964300140004a10080010001a00200028003000380040005a007002700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e9010000000000000000f201005a770a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b80104c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
 ,{"key":"8b898d8a89","value":"030a8f030a057a6f6e65731805200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422b0a06636f6e66696710021a0c08081000180030005011600020013000680070007800800100880100980100480352700a077072696d61727910011801220269642a06636f6e666967300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b2011c0a0c66616d5f325f636f6e66696710021a06636f6e66696720022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
@@ -213,10 +213,10 @@ system hash=594e3fbde512dd058e06f2d4924d08774b8fe41d67025ccc098f0eb051990681
 ,{"key":"d0"}
 ]
 
-tenant hash=8d28a6a45b97e05312c013d50318bbb60e830e6c2e001a4ed1c451f7184d5fdb
+tenant hash=ae1f9d8fc1a1ad8d180b5168a11774fcab532f822a59108db46164414c8297ca
 ----
 [{"key":""}
-,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020047000"}
+,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020067000"}
 ,{"key":"8b898b8a89","value":"030aa0030a0a64657363726970746f721803200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c08081000180030005011600020013000680070007800800100880100980100480352740a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
 ,{"key":"8b898c8a89","value":"030adc050a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018003000501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018003000501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c08001000180030005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055293010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f6964300140004a10080010001a00200028003000380040005a007002700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e9010000000000000000f201005a770a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b80104c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
 ,{"key":"8b898d8a89","value":"030a8f030a057a6f6e65731805200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422b0a06636f6e66696710021a0c08081000180030005011600020013000680070007800800100880100980100480352700a077072696d61727910011801220269642a06636f6e666967300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b2011c0a0c66616d5f325f636f6e66696710021a06636f6e66696720022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
diff --git a/pkg/sql/catalog/systemschema/system.go b/pkg/sql/catalog/systemschema/system.go
index 63676e1ae25b..3f0128e668ba 100644
--- a/pkg/sql/catalog/systemschema/system.go
+++ b/pkg/sql/catalog/systemschema/system.go
@@ -1375,7 +1375,7 @@ const SystemDatabaseName = catconstants.SystemDatabaseName
 // release version).
 //
 // NB: Don't set this to clusterversion.Latest; use a specific version instead.
-var SystemDatabaseSchemaBootstrapVersion = clusterversion.V25_2_AddSqlActivityFlushJob.Version()
+var SystemDatabaseSchemaBootstrapVersion = clusterversion.V25_2_SetUiDefaultTimezoneSetting.Version()
 
 // MakeSystemDatabaseDesc constructs a copy of the system database
 // descriptor.
diff --git a/pkg/sql/catalog/systemschema_test/testdata/bootstrap_system b/pkg/sql/catalog/systemschema_test/testdata/bootstrap_system
index 4f8247d15b0f..7568e8c692c9 100644
--- a/pkg/sql/catalog/systemschema_test/testdata/bootstrap_system
+++ b/pkg/sql/catalog/systemschema_test/testdata/bootstrap_system
@@ -715,7 +715,7 @@ schema_telemetry
 ----
 {"database":{"name":"defaultdb","id":100,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":101}},"defaultPrivileges":{}}}
 {"database":{"name":"postgres","id":102,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":103}},"defaultPrivileges":{}}}
-{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":4}}}
+{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":6}}}
 {"table":{"name":"comments","id":24,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"type","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"object_id","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"sub_id","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"comment","id":4,"type":{"family":"StringFamily","oid":25}}],"nextColumnId":5,"families":[{"name":"primary","columnNames":["type","object_id","sub_id"],"columnIds":[1,2,3]},{"name":"fam_4_comment","id":4,"columnNames":["comment"],"columnIds":[4],"defaultColumnId":4}],"nextFamilyId":5,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["type","object_id","sub_id"],"keyColumnDirections":["ASC","ASC","ASC"],"storeColumnNames":["comment"],"keyColumnIds":[1,2,3],"storeColumnIds":[4],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"public","privileges":"32"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"database_role_settings","id":44,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"database_id","id":1,"type":{"family":"OidFamily","oid":26}},{"name":"role_name","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"settings","id":3,"type":{"family":"ArrayFamily","arrayElemType":"StringFamily","oid":1009,"arrayContents":{"family":"StringFamily","oid":25}}},{"name":"role_id","id":4,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":5,"families":[{"name":"primary","columnNames":["database_id","role_name","settings","role_id"],"columnIds":[1,2,3,4]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["database_id","role_name"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["settings","role_id"],"keyColumnIds":[1,2],"storeColumnIds":[3,4],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":2,"vecConfig":{}},"indexes":[{"name":"database_role_settings_database_id_role_id_key","id":2,"unique":true,"version":3,"keyColumnNames":["database_id","role_id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["settings"],"keyColumnIds":[1,4],"keySuffixColumnIds":[2],"storeColumnIds":[3],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":3}}
 {"table":{"name":"descriptor","id":3,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"descriptor","id":2,"type":{"family":"BytesFamily","oid":17},"nullable":true}],"nextColumnId":3,"families":[{"name":"primary","columnNames":["id"],"columnIds":[1]},{"name":"fam_2_descriptor","id":2,"columnNames":["descriptor"],"columnIds":[2],"defaultColumnId":2}],"nextFamilyId":3,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["descriptor"],"keyColumnIds":[1],"storeColumnIds":[2],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
@@ -784,7 +784,7 @@ schema_telemetry
 schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10
 ----
 {"database":{"name":"defaultdb","id":100,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":101}},"defaultPrivileges":{}}}
-{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":4}}}
+{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":6}}}
 {"table":{"name":"eventlog","id":12,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"timestamp","id":1,"type":{"family":"TimestampFamily","oid":1114}},{"name":"eventType","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"targetID","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"reportingID","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"info","id":5,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"uniqueID","id":6,"type":{"family":"BytesFamily","oid":17},"defaultExpr":"uuid_v4()"}],"nextColumnId":7,"families":[{"name":"primary","columnNames":["timestamp","uniqueID"],"columnIds":[1,6]},{"name":"fam_2_eventType","id":2,"columnNames":["eventType"],"columnIds":[2],"defaultColumnId":2},{"name":"fam_3_targetID","id":3,"columnNames":["targetID"],"columnIds":[3],"defaultColumnId":3},{"name":"fam_4_reportingID","id":4,"columnNames":["reportingID"],"columnIds":[4],"defaultColumnId":4},{"name":"fam_5_info","id":5,"columnNames":["info"],"columnIds":[5],"defaultColumnId":5}],"nextFamilyId":6,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["timestamp","uniqueID"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["eventType","targetID","reportingID","info"],"keyColumnIds":[1,6],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"external_connections","id":53,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"connection_name","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"created","id":2,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"updated","id":3,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"connection_type","id":4,"type":{"family":"StringFamily","oid":25}},{"name":"connection_details","id":5,"type":{"family":"BytesFamily","oid":17}},{"name":"owner","id":6,"type":{"family":"StringFamily","oid":25}},{"name":"owner_id","id":7,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["connection_name","created","updated","connection_type","connection_details","owner","owner_id"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["connection_name"],"keyColumnDirections":["ASC"],"storeColumnNames":["created","updated","connection_type","connection_details","owner","owner_id"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"protected_ts_meta","id":31,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"singleton","id":1,"type":{"oid":16},"defaultExpr":"true"},{"name":"version","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_records","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_spans","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"total_bytes","id":5,"type":{"family":"IntFamily","width":64,"oid":20}}],"nextColumnId":6,"families":[{"name":"primary","columnNames":["singleton","version","num_records","num_spans","total_bytes"],"columnIds":[1,2,3,4,5]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["singleton"],"keyColumnDirections":["ASC"],"storeColumnNames":["version","num_records","num_spans","total_bytes"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"singleton","name":"check_singleton","columnIds":[1],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":3}}
@@ -797,7 +797,7 @@ schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10
 schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10
 ----
 {"database":{"name":"defaultdb","id":100,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":101}},"defaultPrivileges":{}}}
-{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":4}}}
+{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":6}}}
 {"table":{"name":"eventlog","id":12,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"timestamp","id":1,"type":{"family":"TimestampFamily","oid":1114}},{"name":"eventType","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"targetID","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"reportingID","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"info","id":5,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"uniqueID","id":6,"type":{"family":"BytesFamily","oid":17},"defaultExpr":"uuid_v4()"}],"nextColumnId":7,"families":[{"name":"primary","columnNames":["timestamp","uniqueID"],"columnIds":[1,6]},{"name":"fam_2_eventType","id":2,"columnNames":["eventType"],"columnIds":[2],"defaultColumnId":2},{"name":"fam_3_targetID","id":3,"columnNames":["targetID"],"columnIds":[3],"defaultColumnId":3},{"name":"fam_4_reportingID","id":4,"columnNames":["reportingID"],"columnIds":[4],"defaultColumnId":4},{"name":"fam_5_info","id":5,"columnNames":["info"],"columnIds":[5],"defaultColumnId":5}],"nextFamilyId":6,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["timestamp","uniqueID"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["eventType","targetID","reportingID","info"],"keyColumnIds":[1,6],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"external_connections","id":53,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"connection_name","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"created","id":2,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"updated","id":3,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"connection_type","id":4,"type":{"family":"StringFamily","oid":25}},{"name":"connection_details","id":5,"type":{"family":"BytesFamily","oid":17}},{"name":"owner","id":6,"type":{"family":"StringFamily","oid":25}},{"name":"owner_id","id":7,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["connection_name","created","updated","connection_type","connection_details","owner","owner_id"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["connection_name"],"keyColumnDirections":["ASC"],"storeColumnNames":["created","updated","connection_type","connection_details","owner","owner_id"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"protected_ts_meta","id":31,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"singleton","id":1,"type":{"oid":16},"defaultExpr":"true"},{"name":"version","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_records","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_spans","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"total_bytes","id":5,"type":{"family":"IntFamily","width":64,"oid":20}}],"nextColumnId":6,"families":[{"name":"primary","columnNames":["singleton","version","num_records","num_spans","total_bytes"],"columnIds":[1,2,3,4,5]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["singleton"],"keyColumnDirections":["ASC"],"storeColumnNames":["version","num_records","num_spans","total_bytes"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"singleton","name":"check_singleton","columnIds":[1],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":3}}
diff --git a/pkg/sql/catalog/systemschema_test/testdata/bootstrap_tenant b/pkg/sql/catalog/systemschema_test/testdata/bootstrap_tenant
index 4f8247d15b0f..7568e8c692c9 100644
--- a/pkg/sql/catalog/systemschema_test/testdata/bootstrap_tenant
+++ b/pkg/sql/catalog/systemschema_test/testdata/bootstrap_tenant
@@ -715,7 +715,7 @@ schema_telemetry
 ----
 {"database":{"name":"defaultdb","id":100,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":101}},"defaultPrivileges":{}}}
 {"database":{"name":"postgres","id":102,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":103}},"defaultPrivileges":{}}}
-{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":4}}}
+{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":6}}}
 {"table":{"name":"comments","id":24,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"type","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"object_id","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"sub_id","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"comment","id":4,"type":{"family":"StringFamily","oid":25}}],"nextColumnId":5,"families":[{"name":"primary","columnNames":["type","object_id","sub_id"],"columnIds":[1,2,3]},{"name":"fam_4_comment","id":4,"columnNames":["comment"],"columnIds":[4],"defaultColumnId":4}],"nextFamilyId":5,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["type","object_id","sub_id"],"keyColumnDirections":["ASC","ASC","ASC"],"storeColumnNames":["comment"],"keyColumnIds":[1,2,3],"storeColumnIds":[4],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"public","privileges":"32"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"database_role_settings","id":44,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"database_id","id":1,"type":{"family":"OidFamily","oid":26}},{"name":"role_name","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"settings","id":3,"type":{"family":"ArrayFamily","arrayElemType":"StringFamily","oid":1009,"arrayContents":{"family":"StringFamily","oid":25}}},{"name":"role_id","id":4,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":5,"families":[{"name":"primary","columnNames":["database_id","role_name","settings","role_id"],"columnIds":[1,2,3,4]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["database_id","role_name"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["settings","role_id"],"keyColumnIds":[1,2],"storeColumnIds":[3,4],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":2,"vecConfig":{}},"indexes":[{"name":"database_role_settings_database_id_role_id_key","id":2,"unique":true,"version":3,"keyColumnNames":["database_id","role_id"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["settings"],"keyColumnIds":[1,4],"keySuffixColumnIds":[2],"storeColumnIds":[3],"foreignKey":{},"interleave":{},"partitioning":{},"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}}],"nextIndexId":3,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":3}}
 {"table":{"name":"descriptor","id":3,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"id","id":1,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"descriptor","id":2,"type":{"family":"BytesFamily","oid":17},"nullable":true}],"nextColumnId":3,"families":[{"name":"primary","columnNames":["id"],"columnIds":[1]},{"name":"fam_2_descriptor","id":2,"columnNames":["descriptor"],"columnIds":[2],"defaultColumnId":2}],"nextFamilyId":3,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["id"],"keyColumnDirections":["ASC"],"storeColumnNames":["descriptor"],"keyColumnIds":[1],"storeColumnIds":[2],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
@@ -784,7 +784,7 @@ schema_telemetry
 schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10
 ----
 {"database":{"name":"defaultdb","id":100,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":101}},"defaultPrivileges":{}}}
-{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":4}}}
+{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":6}}}
 {"table":{"name":"eventlog","id":12,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"timestamp","id":1,"type":{"family":"TimestampFamily","oid":1114}},{"name":"eventType","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"targetID","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"reportingID","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"info","id":5,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"uniqueID","id":6,"type":{"family":"BytesFamily","oid":17},"defaultExpr":"uuid_v4()"}],"nextColumnId":7,"families":[{"name":"primary","columnNames":["timestamp","uniqueID"],"columnIds":[1,6]},{"name":"fam_2_eventType","id":2,"columnNames":["eventType"],"columnIds":[2],"defaultColumnId":2},{"name":"fam_3_targetID","id":3,"columnNames":["targetID"],"columnIds":[3],"defaultColumnId":3},{"name":"fam_4_reportingID","id":4,"columnNames":["reportingID"],"columnIds":[4],"defaultColumnId":4},{"name":"fam_5_info","id":5,"columnNames":["info"],"columnIds":[5],"defaultColumnId":5}],"nextFamilyId":6,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["timestamp","uniqueID"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["eventType","targetID","reportingID","info"],"keyColumnIds":[1,6],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"external_connections","id":53,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"connection_name","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"created","id":2,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"updated","id":3,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"connection_type","id":4,"type":{"family":"StringFamily","oid":25}},{"name":"connection_details","id":5,"type":{"family":"BytesFamily","oid":17}},{"name":"owner","id":6,"type":{"family":"StringFamily","oid":25}},{"name":"owner_id","id":7,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["connection_name","created","updated","connection_type","connection_details","owner","owner_id"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["connection_name"],"keyColumnDirections":["ASC"],"storeColumnNames":["created","updated","connection_type","connection_details","owner","owner_id"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"protected_ts_meta","id":31,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"singleton","id":1,"type":{"oid":16},"defaultExpr":"true"},{"name":"version","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_records","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_spans","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"total_bytes","id":5,"type":{"family":"IntFamily","width":64,"oid":20}}],"nextColumnId":6,"families":[{"name":"primary","columnNames":["singleton","version","num_records","num_spans","total_bytes"],"columnIds":[1,2,3,4,5]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["singleton"],"keyColumnDirections":["ASC"],"storeColumnNames":["version","num_records","num_spans","total_bytes"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"singleton","name":"check_singleton","columnIds":[1],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":3}}
@@ -797,7 +797,7 @@ schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10
 schema_telemetry snapshot_id=7cd8a9ae-f35c-4cd2-970a-757174600874 max_records=10
 ----
 {"database":{"name":"defaultdb","id":100,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2","withGrantOption":"2"},{"userProto":"public","privileges":"2048"},{"userProto":"root","privileges":"2","withGrantOption":"2"}],"ownerProto":"root","version":3},"schemas":{"public":{"id":101}},"defaultPrivileges":{}}}
-{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":4}}}
+{"database":{"name":"system","id":1,"modificationTime":{"wallTime":"0"},"version":"1","privileges":{"users":[{"userProto":"admin","privileges":"2048","withGrantOption":"2048"},{"userProto":"root","privileges":"2048","withGrantOption":"2048"}],"ownerProto":"node","version":3},"systemDatabaseSchemaVersion":{"majorVal":1000025,"minorVal":1,"internal":6}}}
 {"table":{"name":"eventlog","id":12,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"timestamp","id":1,"type":{"family":"TimestampFamily","oid":1114}},{"name":"eventType","id":2,"type":{"family":"StringFamily","oid":25}},{"name":"targetID","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"reportingID","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"info","id":5,"type":{"family":"StringFamily","oid":25},"nullable":true},{"name":"uniqueID","id":6,"type":{"family":"BytesFamily","oid":17},"defaultExpr":"uuid_v4()"}],"nextColumnId":7,"families":[{"name":"primary","columnNames":["timestamp","uniqueID"],"columnIds":[1,6]},{"name":"fam_2_eventType","id":2,"columnNames":["eventType"],"columnIds":[2],"defaultColumnId":2},{"name":"fam_3_targetID","id":3,"columnNames":["targetID"],"columnIds":[3],"defaultColumnId":3},{"name":"fam_4_reportingID","id":4,"columnNames":["reportingID"],"columnIds":[4],"defaultColumnId":4},{"name":"fam_5_info","id":5,"columnNames":["info"],"columnIds":[5],"defaultColumnId":5}],"nextFamilyId":6,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["timestamp","uniqueID"],"keyColumnDirections":["ASC","ASC"],"storeColumnNames":["eventType","targetID","reportingID","info"],"keyColumnIds":[1,6],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"external_connections","id":53,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"connection_name","id":1,"type":{"family":"StringFamily","oid":25}},{"name":"created","id":2,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"updated","id":3,"type":{"family":"TimestampFamily","oid":1114},"defaultExpr":"now():::TIMESTAMP"},{"name":"connection_type","id":4,"type":{"family":"StringFamily","oid":25}},{"name":"connection_details","id":5,"type":{"family":"BytesFamily","oid":17}},{"name":"owner","id":6,"type":{"family":"StringFamily","oid":25}},{"name":"owner_id","id":7,"type":{"family":"OidFamily","oid":26}}],"nextColumnId":8,"families":[{"name":"primary","columnNames":["connection_name","created","updated","connection_type","connection_details","owner","owner_id"],"columnIds":[1,2,3,4,5,6,7]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["connection_name"],"keyColumnDirections":["ASC"],"storeColumnNames":["created","updated","connection_type","connection_details","owner","owner_id"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5,6,7],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"480","withGrantOption":"480"},{"userProto":"root","privileges":"480","withGrantOption":"480"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":2}}
 {"table":{"name":"protected_ts_meta","id":31,"version":"1","modificationTime":{},"parentId":1,"unexposedParentSchemaId":29,"columns":[{"name":"singleton","id":1,"type":{"oid":16},"defaultExpr":"true"},{"name":"version","id":2,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_records","id":3,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"num_spans","id":4,"type":{"family":"IntFamily","width":64,"oid":20}},{"name":"total_bytes","id":5,"type":{"family":"IntFamily","width":64,"oid":20}}],"nextColumnId":6,"families":[{"name":"primary","columnNames":["singleton","version","num_records","num_spans","total_bytes"],"columnIds":[1,2,3,4,5]}],"nextFamilyId":1,"primaryIndex":{"name":"primary","id":1,"unique":true,"version":4,"keyColumnNames":["singleton"],"keyColumnDirections":["ASC"],"storeColumnNames":["version","num_records","num_spans","total_bytes"],"keyColumnIds":[1],"storeColumnIds":[2,3,4,5],"foreignKey":{},"interleave":{},"partitioning":{},"encodingType":1,"sharded":{},"geoConfig":{},"constraintId":1,"vecConfig":{}},"nextIndexId":2,"privileges":{"users":[{"userProto":"admin","privileges":"32","withGrantOption":"32"},{"userProto":"root","privileges":"32","withGrantOption":"32"}],"ownerProto":"node","version":3},"nextMutationId":1,"formatVersion":3,"checks":[{"expr":"singleton","name":"check_singleton","columnIds":[1],"constraintId":2}],"replacementOf":{"time":{}},"createAsOfTime":{},"nextConstraintId":3}}
diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog b/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog
index 27f752090b47..7448ccb86c86 100644
--- a/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog
+++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog
@@ -110,7 +110,7 @@ skipif config local-mixed-24.3 local-mixed-25.1
 query IT
 SELECT id, strip_volatile(descriptor) FROM crdb_internal.kv_catalog_descriptor WHERE id IN (1, 2, 3, 29, 4294966962) OR (id > 100 and id < 200) ORDER BY id
 ----
-1           {"database": {"id": 1, "name": "system", "privileges": {"ownerProto": "node", "users": [{"privileges": "2048", "userProto": "admin", "withGrantOption": "2048"}, {"privileges": "2048", "userProto": "root", "withGrantOption": "2048"}], "version": 3}, "systemDatabaseSchemaVersion": {"internal": 4, "majorVal": 1000025, "minorVal": 1}, "version": "1"}}
+1           {"database": {"id": 1, "name": "system", "privileges": {"ownerProto": "node", "users": [{"privileges": "2048", "userProto": "admin", "withGrantOption": "2048"}, {"privileges": "2048", "userProto": "root", "withGrantOption": "2048"}], "version": 3}, "systemDatabaseSchemaVersion": {"internal": 6, "majorVal": 1000025, "minorVal": 1}, "version": "1"}}
 3           {"table": {"columns": [{"id": 1, "name": "id", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "descriptor", "nullable": true, "type": {"family": "BytesFamily", "oid": 17}}], "formatVersion": 3, "id": 3, "name": "descriptor", "nextColumnId": 3, "nextConstraintId": 2, "nextIndexId": 2, "nextMutationId": 1, "parentId": 1, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [1], "keyColumnNames": ["id"], "name": "primary", "partitioning": {}, "sharded": {}, "storeColumnIds": [2], "storeColumnNames": ["descriptor"], "unique": true, "vecConfig": {}, "version": 4}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "admin", "withGrantOption": "32"}, {"privileges": "32", "userProto": "root", "withGrantOption": "32"}], "version": 3}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 29, "version": "1"}}
 29          {"schema": {"defaultPrivileges": {"type": "SCHEMA"}, "id": 29, "name": "public", "privileges": {"ownerProto": "node", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "516", "userProto": "public"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 3}, "version": "1"}}
 101         {"schema": {"id": 101, "name": "public", "parentId": 100, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "516", "userProto": "public"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 3}, "version": "1"}}
diff --git a/pkg/ui/settings/BUILD.bazel b/pkg/ui/settings/BUILD.bazel
new file mode 100644
index 000000000000..aacdb4da812a
--- /dev/null
+++ b/pkg/ui/settings/BUILD.bazel
@@ -0,0 +1,25 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "settings",
+    srcs = ["settings.go"],
+    importpath = "github.com/cockroachdb/cockroach/pkg/ui/settings",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//pkg/settings",
+        "//pkg/util/timeutil",
+        "@com_github_cockroachdb_errors//:errors",
+    ],
+)
+
+go_test(
+    name = "settings_test",
+    srcs = ["settings_test.go"],
+    embed = [":settings"],
+    deps = [
+        "//pkg/settings/cluster",
+        "//pkg/util/leaktest",
+        "//pkg/util/log",
+        "@com_github_stretchr_testify//require",
+    ],
+)
diff --git a/pkg/ui/settings/settings.go b/pkg/ui/settings/settings.go
new file mode 100644
index 000000000000..62d290a40603
--- /dev/null
+++ b/pkg/ui/settings/settings.go
@@ -0,0 +1,52 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package uisettings
+
+import (
+	"github.com/cockroachdb/cockroach/pkg/settings"
+	"github.com/cockroachdb/cockroach/pkg/util/timeutil"
+	"github.com/cockroachdb/errors"
+)
+
+const (
+	utc int64 = iota
+	americaNewYork
+)
+
+// DefaultTimezone is the timezone used to format timestamps in the UI. Any valid
+// timezone is supported. For the sake of backwards compatability, the default of
+// this setting is empty, which ultimately allows for the frontend to choose the
+// final default value if none is set in the cluster.
+var DefaultTimezone = settings.RegisterStringSetting(
+	settings.ApplicationLevel,
+	"ui.default_timezone",
+	"the default timezone used to format timestamps in the ui",
+	"",
+	settings.WithValidateString(func(sv *settings.Values, v string) error {
+		_, err := timeutil.LoadLocation(v)
+		if err != nil {
+			return errors.Wrap(err, "invalid timezone")
+		}
+		return nil
+	}),
+	settings.WithPublic)
+
+var DisplayTimezoneEnums = map[int64]string{
+	utc:            "Etc/UTC",
+	americaNewYork: "America/New_York",
+}
+
+// TODO (kyle.wong): This setting is deprecated and should be removed
+// in a future version, probably v25.4.
+var DisplayTimezone = settings.RegisterEnumSetting(
+	settings.ApplicationLevel,
+	"ui.display_timezone",
+	"the timezone used to format timestamps in the ui. This setting is deprecated"+
+		"and will be removed in a future version. Use the 'ui.default_timezone' setting "+
+		"instead. 'ui.default_timezone' takes precedence over this setting.",
+	"Etc/UTC",
+	DisplayTimezoneEnums,
+	settings.WithPublic)
diff --git a/pkg/ui/settings/settings_test.go b/pkg/ui/settings/settings_test.go
new file mode 100644
index 000000000000..0e768a7b5661
--- /dev/null
+++ b/pkg/ui/settings/settings_test.go
@@ -0,0 +1,48 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package uisettings
+
+import (
+	"context"
+	"testing"
+
+	"github.com/cockroachdb/cockroach/pkg/settings/cluster"
+	"github.com/cockroachdb/cockroach/pkg/util/leaktest"
+	"github.com/cockroachdb/cockroach/pkg/util/log"
+	"github.com/stretchr/testify/require"
+)
+
+func TestUIHandler_DefaultTimezone(t *testing.T) {
+	defer leaktest.AfterTest(t)()
+	defer log.Scope(t).Close(t)
+
+	testSettings := cluster.MakeTestingClusterSettings()
+
+	DefaultTimezone.Override(context.Background(), &testSettings.SV, "America/New_York")
+	require.Equal(t, "America/New_York", DefaultTimezone.Get(&testSettings.SV))
+
+	testcases := []struct {
+		name     string
+		timezone string
+		valid    bool
+	}{
+		{"empty", "", true},
+		{"canonical", "Africa/Abidjan", true},
+		{"link", "US/Eastern", true},
+		{"invalid", "invalid/timezone", false},
+	}
+
+	for _, tc := range testcases {
+		t.Run(tc.name, func(t *testing.T) {
+			DefaultTimezone.Override(context.Background(), &testSettings.SV, tc.timezone)
+			if tc.valid {
+				require.NoError(t, DefaultTimezone.Validate(&testSettings.SV, tc.timezone))
+			} else {
+				require.Error(t, DefaultTimezone.Validate(&testSettings.SV, tc.timezone))
+			}
+		})
+	}
+}
diff --git a/pkg/ui/ui.go b/pkg/ui/ui.go
index 7736ae78a129..782f77198a83 100644
--- a/pkg/ui/ui.go
+++ b/pkg/ui/ui.go
@@ -31,8 +31,6 @@ import (
 )
 
 const (
-	utc int64 = iota
-	americaNewYork
 	cspHeader = "default-src 'self'; " +
 		"style-src 'self' 'unsafe-inline'; " +
 		"font-src 'self' data:; " +
@@ -40,21 +38,6 @@ const (
 		"connect-src 'self' https://register.cockroachdb.com;"
 )
 
-var _ = settings.RegisterEnumSetting(
-	settings.ApplicationLevel,
-	"ui.display_timezone",
-	"the timezone used to format timestamps in the ui",
-	"Etc/UTC",
-	map[int64]string{
-		utc:            "Etc/UTC",
-		americaNewYork: "America/New_York",
-		// Adding new timezones?
-		// Add them to the allowlist of included timezones!
-		// See pkg/ui/workspaces/cluster-ui/webpack.config.js
-		// and pkg/ui/workspaces/db-console/webpack.config.js.
-	},
-	settings.WithPublic)
-
 // TODO(davidh): This setting can be removed after 24.3 since it only
 // affects legacy DB page.
 var DatabaseLocalityMetadataEnabled = settings.RegisterBoolSetting(
diff --git a/pkg/ui/workspaces/cluster-ui/webpack.config.js b/pkg/ui/workspaces/cluster-ui/webpack.config.js
index 3baa2d284825..5c94930a173e 100644
--- a/pkg/ui/workspaces/cluster-ui/webpack.config.js
+++ b/pkg/ui/workspaces/cluster-ui/webpack.config.js
@@ -164,9 +164,8 @@ module.exports = (env, argv) => {
         profile: true,
       }),
       new MomentLocalesPlugin(),
-      // Use MomentTimezoneDataPlugin to remove timezone data that we don't need.
+      // Use MomentTimezoneDataPlugin to include all timezone data
       new MomentTimezoneDataPlugin({
-        matchZones: ['Etc/UTC', 'America/New_York'],
         startYear: 2021,
         endYear: currentYear + 10,
         // We have to tell the plugin where to store the pruned file
diff --git a/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts b/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts
index 0d82b4edbe34..402bc0c7ccc4 100644
--- a/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts
+++ b/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts
@@ -23,7 +23,11 @@ export const selectTimezoneSetting = createSelector(
     if (!settings) {
       return CoordinatedUniversalTime;
     }
-    return settings["ui.display_timezone"]?.value || CoordinatedUniversalTime;
+    return (
+      settings["ui.default_timezone"]?.value ||
+      settings["ui.display_timezone"]?.value ||
+      CoordinatedUniversalTime
+    );
   },
 );
 
diff --git a/pkg/ui/workspaces/db-console/webpack.config.js b/pkg/ui/workspaces/db-console/webpack.config.js
index 5c783824b79e..f97769d5ccba 100644
--- a/pkg/ui/workspaces/db-console/webpack.config.js
+++ b/pkg/ui/workspaces/db-console/webpack.config.js
@@ -47,9 +47,8 @@ module.exports = (env, argv) => {
       profile: true,
     }),
 
-    // Use MomentTimezoneDataPlugin to remove timezone data that we don't need.
+    // Use MomentTimezoneDataPlugin to include all timezone data
     new MomentTimezoneDataPlugin({
-      matchZones: ["Etc/UTC", "America/New_York"],
       startYear: 2021,
       endYear: currentYear + 10,
       // We have to tell the plugin where to store the pruned file
diff --git a/pkg/upgrade/upgrades/BUILD.bazel b/pkg/upgrade/upgrades/BUILD.bazel
index c68b4dab551d..64750071a655 100644
--- a/pkg/upgrade/upgrades/BUILD.bazel
+++ b/pkg/upgrade/upgrades/BUILD.bazel
@@ -19,6 +19,7 @@ go_library(
         "v25_1_add_jobs_tables.go",
         "v25_1_prepared_transactions_table.go",
         "v25_2_add_sql_activity_flush_job.go",
+        "v25_2_set_ui_default_timezone.go",
     ],
     importpath = "github.com/cockroachdb/cockroach/pkg/upgrade/upgrades",
     visibility = ["//visibility:public"],
@@ -52,6 +53,7 @@ go_library(
         "//pkg/sql/sessiondata",
         "//pkg/sql/sqlstats/sqlactivityjob",
         "//pkg/sql/tablemetadatacache",
+        "//pkg/ui/settings",
         "//pkg/upgrade",
         "//pkg/upgrade/upgradebase",
         "//pkg/util/envutil",
@@ -84,6 +86,7 @@ go_test(
         "upgrades_test.go",
         "v25_1_add_jobs_tables_test.go",
         "v25_1_prepared_transactions_table_test.go",
+        "v25_2_set_ui_default_timezone_test.go",
         "version_starvation_test.go",
     ],
     data = glob(["testdata/**"]),
@@ -129,6 +132,7 @@ go_test(
         "//pkg/testutils/skip",
         "//pkg/testutils/sqlutils",
         "//pkg/testutils/testcluster",
+        "//pkg/ui/settings",
         "//pkg/upgrade",
         "//pkg/upgrade/upgradebase",
         "//pkg/util/ctxgroup",
@@ -141,5 +145,6 @@ go_test(
         "@com_github_cockroachdb_errors//:errors",
         "@com_github_stretchr_testify//assert",
         "@com_github_stretchr_testify//require",
+        "@org_golang_x_exp//maps",
     ],
 )
diff --git a/pkg/upgrade/upgrades/upgrades.go b/pkg/upgrade/upgrades/upgrades.go
index f0cc715c64d8..5360b1144684 100644
--- a/pkg/upgrade/upgrades/upgrades.go
+++ b/pkg/upgrade/upgrades/upgrades.go
@@ -101,6 +101,14 @@ var upgrades = []upgradebase.Upgrade{
 		upgrade.RestoreActionNotRequired("cluster restore does not restore this job"),
 	),
 
+	upgrade.NewTenantUpgrade(
+		"set new ui.default_timezone setting to ui.display_timezone value",
+		clusterversion.V25_2_SetUiDefaultTimezoneSetting.Version(),
+		upgrade.NoPrecondition,
+		setUiDefaultTimezone,
+		upgrade.RestoreActionNotRequired("cluster restore does not restore this setting"),
+	),
+
 	// Note: when starting a new release version, the first upgrade (for
 	// Vxy_zStart) must be a newFirstUpgrade. Keep this comment at the bottom.
 }
diff --git a/pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go b/pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
new file mode 100644
index 000000000000..b7ad34066b95
--- /dev/null
+++ b/pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
@@ -0,0 +1,40 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/settings"
+	uisettings "github.com/cockroachdb/cockroach/pkg/ui/settings"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, _ clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+
+	// Set ui.default_timezone to the value of ui.display_timezone if it has been
+	// explicitly set.
+	if uisettings.DisplayTimezone.ValueOrigin(ctx, &d.Settings.SV) == settings.OriginExplicitlySet {
+		tz := uisettings.DisplayTimezone.String(&d.Settings.SV)
+		if _, err := d.DB.Executor().Exec(
+			ctx,
+			"set-default-timezone",
+			nil,
+			"SET cluster setting ui.default_timezone=$1",
+			tz); err != nil {
+			return err
+		}
+	}
+	return nil
+}
diff --git a/pkg/upgrade/upgrades/v25_2_set_ui_default_timezone_test.go b/pkg/upgrade/upgrades/v25_2_set_ui_default_timezone_test.go
new file mode 100644
index 000000000000..376ab14e5adc
--- /dev/null
+++ b/pkg/upgrade/upgrades/v25_2_set_ui_default_timezone_test.go
@@ -0,0 +1,82 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades_test
+
+import (
+	"context"
+	"fmt"
+	"strings"
+	"testing"
+
+	"github.com/cockroachdb/cockroach/pkg/base"
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/server"
+	"github.com/cockroachdb/cockroach/pkg/testutils"
+	"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
+	"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
+	uisettings "github.com/cockroachdb/cockroach/pkg/ui/settings"
+	"github.com/cockroachdb/cockroach/pkg/upgrade/upgrades"
+	"github.com/cockroachdb/cockroach/pkg/util/leaktest"
+	"github.com/cockroachdb/cockroach/pkg/util/log"
+	"github.com/stretchr/testify/require"
+	"golang.org/x/exp/maps"
+)
+
+func TestSetUiDefaultTimezone(t *testing.T) {
+	defer leaktest.AfterTest(t)()
+	defer log.Scope(t).Close(t)
+
+	ctx := context.Background()
+	clusterversion.SkipWhenMinSupportedVersionIsAtLeast(t, clusterversion.V25_2)
+	clusterArgs := base.TestClusterArgs{
+		ServerArgs: base.TestServerArgs{
+			Knobs: base.TestingKnobs{
+				Server: &server.TestingKnobs{
+					DisableAutomaticVersionUpgrade: make(chan struct{}),
+					ClusterVersionOverride:         clusterversion.MinSupported.Version(),
+				},
+			},
+		},
+	}
+
+	testutils.RunValues(t, "display_timezone", maps.Values(uisettings.DisplayTimezoneEnums), func(t *testing.T, val string) {
+		cluster := testcluster.StartTestCluster(t, 1, clusterArgs)
+		defer cluster.Stopper().Stop(ctx)
+		sqlDB := cluster.ServerConn(0)
+
+		var displayTimezoneVal string
+		var defaultTimezoneVal string
+		runner := sqlutils.MakeSQLRunner(sqlDB)
+		runner.Exec(t, fmt.Sprintf("SET cluster setting ui.display_timezone = '%s'", val))
+		runner.QueryRow(t, "SHOW cluster setting ui.display_timezone").Scan(&displayTimezoneVal)
+		// cast to lower case because enum setting type sets all setting values to lower case
+		require.Equal(t, strings.ToLower(val), displayTimezoneVal)
+
+		upgrades.Upgrade(t, sqlDB, clusterversion.V25_2_SetUiDefaultTimezoneSetting, nil, false)
+
+		runner.QueryRow(t, "SHOW cluster setting ui.default_timezone").Scan(&defaultTimezoneVal)
+		require.Equal(t, strings.ToLower(val), defaultTimezoneVal)
+	})
+
+	t.Run("display_timezone=default", func(t *testing.T) {
+		cluster := testcluster.StartTestCluster(t, 1, clusterArgs)
+		defer cluster.Stopper().Stop(ctx)
+		sqlDB := cluster.ServerConn(0)
+		runner := sqlutils.MakeSQLRunner(sqlDB)
+
+		var displayTimezoneVal string
+		var defaultTimezoneVal string
+
+		runner.QueryRow(t, "SHOW cluster setting ui.display_timezone").Scan(&displayTimezoneVal)
+		require.Equal(t, strings.ToLower(uisettings.DisplayTimezone.DefaultString()), displayTimezoneVal)
+
+		upgrades.Upgrade(t, sqlDB, clusterversion.V25_2_SetUiDefaultTimezoneSetting, nil, false)
+		runner.QueryRow(t, "SHOW cluster setting ui.default_timezone").Scan(&defaultTimezoneVal)
+		// Since ui.display_timezone has not been set, `ui.default_timezone` should
+		// still be the default value.
+		require.Equal(t, uisettings.DefaultTimezone.Default(), defaultTimezoneVal)
+	})
+}


Reviews:
user: login: xinhaoz
body: Code changes LGTM. Just wondering if we have a preceding protocol to follow when changing cluster setting types between vesions. Is there no way to preserve the previous value on ugprades?
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T20:54:24Z
user: login: xinhaoz
body: LGTM! Thanks for following up. Just the one question, feel free to resolve if possible or keep as is.
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T18:22:10Z
user: login: dt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T18:33:39Z
user: login: dt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T18:39:18Z
user: login: kyle-a-wong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T19:17:27Z
user: login: kyle-a-wong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T19:17:32Z
user: login: kyle-a-wong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T19:19:40Z
user: login: dt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T19:24:39Z
user: login: kyle-a-wong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T19:37:21Z
user: login: dt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T19:41:49Z
user: login: kyle-a-wong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T20:01:23Z

Review comments:
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: xinhaoz
body: Just wondering but is it possible to read the setting directly via `d.Settings.SV`?
created_at: 2025-04-01T18:19:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: dt
body: not transactionally with the write of the new setting. That said, the write being done here -- via SET -- isn't transactional either so I guess you could just read the in-mem value and be just as correct?
created_at: 2025-04-01T18:33:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
+
+	if err != nil {
+		return err
+	}
+
+	if len(row) == 0 || row[0] == nil {
+		return nil
+	}
+
+	// value is a string representation of the enum value for the display
+	// timezone.
+	value := string(tree.MustBeDString(row[0]))
+	enumVal, err := strconv.Atoi(value)
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: dt
body: does `ui.DisplayTimezone.DecodeToString()` do what you want here?
created_at: 2025-04-01T18:36:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: dt
body: we could move `ui.DisplayTimezone` to a minimal standalone package e.g. `pkg/ui/uisetting` to avoid having pkg/upgrade/upgrades depend on pkg/ui just to get the setting def, which IIRC can be a hefty package to build?
created_at: 2025-04-01T18:39:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: kyle-a-wong
body: Done
created_at: 2025-04-01T19:17:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
+
+	if err != nil {
+		return err
+	}
+
+	if len(row) == 0 || row[0] == nil {
+		return nil
+	}
+
+	// value is a string representation of the enum value for the display
+	// timezone.
+	value := string(tree.MustBeDString(row[0]))
+	enumVal, err := strconv.Atoi(value)
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: kyle-a-wong
body: Nice, I should've looked for this method instead of handrolling it myself. Done.
created_at: 2025-04-01T19:17:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: kyle-a-wong
body: I opted not to use this so that we can distinguish between set and unset. We will only set the new setting if the old setting has explicitly been set. If it is not set (default value is "") it should fall back to UI's defined default tz.
created_at: 2025-04-01T19:19:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: dt
body: if you want to use the cache, you can find out if the value you read is an explicitly set value read from the table vs one that came from the default (or from some external override) by checking `someSetting.ValueOrigin(ctx, &SV) == settings.OriginExplicitlySet` 
created_at: 2025-04-01T19:24:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: kyle-a-wong
body: Awesome, thanks for this pointer. Updated to use the value read from `d.Settings.SV`
created_at: 2025-04-01T19:37:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: dt
body: LGTM.

Just to confirm though, as I mentioned earlier, none of this is transactional -- I gathered from the earlier revision here not using a txn that that is okay?
created_at: 2025-04-01T19:41:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+// Copyright 2025 The Cockroach Authors.
+//
+// Use of this software is governed by the CockroachDB Software License
+// included in the /LICENSE file.
+
+package upgrades
+
+import (
+	"context"
+	"strconv"
+
+	"github.com/cockroachdb/cockroach/pkg/clusterversion"
+	"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
+	"github.com/cockroachdb/cockroach/pkg/ui"
+	"github.com/cockroachdb/cockroach/pkg/upgrade"
+)
+
+// setUiDefaultTimezone sets the value of the 'ui.default_timezone' cluster
+// setting to be the same as the 'ui.display_timezone' setting if it is set.
+// 'ui.default_timezone' is the new cluster setting to replace
+// 'ui.display_timezone' which doesn't have any restrictions on which timezones
+// can be set.
+func setUiDefaultTimezone(
+	ctx context.Context, version clusterversion.ClusterVersion, d upgrade.TenantDeps,
+) error {
+	// Get the value of the 'ui.display_timezone' setting, if it has been
+	// overridden.
+	row, err := d.DB.Executor().QueryRow(
+		ctx,
+		"get-display-timezone",
+		nil,
+		"SELECT value FROM system.settings WHERE name = 'ui.display_timezone'")
path: pkg/upgrade/upgrades/v25_2_set_ui_default_timezone.go
user: login: kyle-a-wong
body: Yeah its okay that it is not using a transaction.
created_at: 2025-04-01T20:01:23Z
author_association: CONTRIBUTOR

PR comments:
user: login: kyle-a-wong
created_at: 2025-03-26T15:05:10Z
body: https://www.loom.com/share/24d54c0a907741b996c1f1c719585e5f?sid=1665f1f1-6c29-47fc-877a-6155ed2a200d
author_association: CONTRIBUTOR
user: login: cockroach-teamcity
created_at: 2025-03-26T15:05:14Z
body: 

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/cockroachdb/cockroach/143499)
<!-- Reviewable:end -->

author_association: MEMBER
user: login: kyle-a-wong
created_at: 2025-03-31T14:40:39Z
body: > Code changes LGTM. Just wondering if we have a preceding protocol to follow when changing cluster setting types between vesions. Is there no way to preserve the previous value on ugprades?

@xinhaoz I made some changes to this PR and changed up the implementation. Instead of changing the type of an existing cluster setting, there is nwo a new `ui.default_timezone` cluster setting that is backfilled via a cluster upgrade. Take another look when you have a chance. I'll also update the video to reflect the new change
author_association: CONTRIBUTOR
user: login: kyle-a-wong
created_at: 2025-04-02T15:53:34Z
body: Bazel extended CI job is failing, but it is unrelated to this change. See GH issue: #143815.

tftr!

bors r+
author_association: CONTRIBUTOR
user: login: craig[bot]
created_at: 2025-04-02T17:01:25Z
body: Build succeeded:
  * [local_roachtest](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860717001)
  * [linux_amd64_fips_build](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860716595)
  * [lint](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860715552)
  * [unit_tests](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860717426)
  * [acceptance](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860713828)
  * [check_generated_code](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860714769)
  * [docker_image_amd64](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860714269)
  * [examples_orms](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860715219)
  * local_roachtest_fips
  * [linux_amd64_build](https://github.com/cockroachdb/cockroach/actions/runs/14224542808/job/39860716079)
author_association: CONTRIBUTOR