Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: implement the pg_timezone_names table #94122

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

otan
Copy link
Contributor

@otan otan commented Dec 22, 2022

Informs #84505

Release note (sql change): Implement the pg_timezone_names pg_catalog table, which lists all supported timezones.

@otan otan requested review from rafiss and a team December 22, 2022 04:52
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is timely! we just got cockroachdb/docs#15873, and looks like this will resolve it

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan)


pkg/sql/pg_catalog.go line 4154 at r1 (raw file):

func addRowForTimezoneNames(tz string, t time.Time, addRow func(...tree.Datum) error) error {
	abbrev, offset := t.Zone()
	d := duration.MakeDuration(int64(offset)*int64(time.Second), 0, 0)

what is this multiplication meant to calculate?


pkg/sql/pg_catalog.go line 4159 at r1 (raw file):

		tree.NewDString(abbrev), // abbrev
		tree.NewDInterval(d, types.DefaultIntervalTypeMetadata), // utc_offset
		tree.MakeDBool(tree.DBool(t.IsDST())),                   // is_dist

nit: comment should be is_dst

@otan otan force-pushed the pg_timezone_names branch 3 times, most recently from 86564a0 to 4bfa781 Compare December 22, 2022 22:37
@otan
Copy link
Contributor Author

otan commented Dec 22, 2022

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Dec 23, 2022

Merge conflict.

Release note (sql change): Implement the `pg_timezone_names` pg_catalog
table, which lists all supported timezones.
@otan otan force-pushed the pg_timezone_names branch from 4bfa781 to e1be665 Compare December 23, 2022 03:28
@otan
Copy link
Contributor Author

otan commented Dec 23, 2022

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Dec 23, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants