-
Notifications
You must be signed in to change notification settings - Fork 451
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
Document the TIMETZ type #3102
Document the TIMETZ type #3102
Conversation
Generally the timetz part looks pretty good, except that we don't recommend use of TIMETZ. Review status: 0 of 3 files reviewed at latest revision, all discussions resolved, all commit checks successful. v2.1/time.md, line 24 at r1 (raw file):
We actually do not recommend use of Say in the SQL command line, when we are executing the following query: However, if we store In addition, in the original postgres doc, it doesn't recommend use of timetz either. Comments from Reviewable |
Thanks for the feedback, @windchan7! @rmloveland will take this over. I incorrectly assumed that the best practices for |
@jseldess Yeah, time types are confusing. I would say we should always recommend using |
@windchan7, I just pushed some updates based on your feedback (summary of changes in commit message). Let me know what you think! |
Hey @windchan7, would appreciate a review of the latest updates whenever you have cycles. Thank you! |
Sorry I missed your message earlier.
Review status: 0 of 6 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. Comments from Reviewable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with 2 last nits.
v2.1/timestamp.md
Outdated
@@ -53,7 +53,7 @@ ISO 8601 | `TIMESTAMP '2016-01-25T10:10:10.555555'` | |||
To express a `TIMESTAMPTZ` value (with time zone offset from UTC), use | |||
the following format: `TIMESTAMPTZ '2016-01-25 10:10:10.555555-05:00'` | |||
|
|||
When it is unambiguous, a simple unannotated string literal can also | |||
When it is unambiguous, a simple unannotated [string literals](sql-constants.html#string-literals) can also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: string literals
> string literal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed - thanks for the catch!
v2.1/time.md
Outdated
- Comparing `TIMETZ` instances using [operators such as `>`](functions-and-operators.html#operators) | ||
- [Ordering query results](query-order.html) which include `TIMETZ` values in time order, e.g., `SELECT * FROM table ORDER BY column_with_timetz_type`. | ||
|
||
[Like Postgres](https://www.postgresql.org/docs/current/static/datatype-datetime.html), we implement the `TIMETZ` variant for [SQL standards compliance](sql-feature-support.html), and also because it is used by ORMs like [Hibernate](build-a-java-app-with-cockroachdb-hibernate.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra space before ORMs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Fixes #2982 Summary of changes: - Make clear that TIMETZ is not really recommended, just there for SQL standard and ORM support (2.1) - Give examples of wonkiness: comparisons and ordering (2.1) - Update SQL Feature page with TIME data type (2.0 and 2.1) - Update example to use TIME, not TIMETZ - Add links to other related docs as appropriate: Postgres time stuff and wire protocol, Cockroach SQL feature page and functions/operators - Fixed a few small typos/copy-edits - Also minor tweaks to the TIMEZONE type docs
Also minor tweaks to the TIMEZONE type docs.
Fixes #2982