-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: support optional TIMESTAMP precision #32098
Comments
Note: when we support this feature we can re-introduce nanosecond precision (eg via |
cc @mjibson we discussed that today |
[Moved to #32143] |
Matt thanks for the explanation but this is not the right issue. Can you please file a separate issue for this discussion about intervals, and copy/paste your analysis into it. Thanks
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Oops. Moved to #32143. |
…tamp with precision This also somewhat simplifies the grammar. Release note: None
…tamp with precision This also somewhat simplifies the grammar. Release note: None
…tamp with precision This also somewhat simplifies the grammar. Release note: None
Double check #16349 when working on this. Verify whether |
I ran into this issue on Symfony4/Doctrine, Symfony4 log
I installed the latest CockroachDB v2.1.4 (and later v2.2.0-alpha.20190114 also), set up a Symfony4/Doctrine project, configured it with If the SQL is changed to This is related to #16349 too because Symfony4/Doctrine specifically ask for TIMESTAMP(0), but at the moment it is not accepting any kind of precision value. In Symfony4/Doctrine this issue can be worked around by deleting all the precision entries from the
This one leaves me utterly clueless, but I saw this specific query was mentioned by @Freeaqingme on #3288. |
Thanks for your report! I extracted the request about the correlated subquery into a separate issue #34776 |
35128: sql: accept+ignore precision 6 on TIME,TIMESTAMP,TIMESTAMPTZ r=knz a=knz Informs #32098. Informs #32565. This is not the full feature but might unlock Flowable compat. cc @rolandcrosby @awoods187 @drewdeally Release note (sql change): CockroachDB now recognizes the syntax `TIME(6)`, `TIMESTAMP(6)` and `TIMESTAMPTZ(6)` / `TIMESTAMP(6) WITH TIME ZONE`, for compatibility with PostgreSQL. Only the value 6 is supported (which is also the default in PostgreSQL). When used for a table column definition, the precision is not stored and it is not possible to distinguish types with and without specified precisions in the introspection metadata. Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@knz was this addressed with your change? |
No.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
41788: storage/rangefeed: push rangefeed.Filter into Raft processing goroutine r=danhhz a=nvanbenschoten This commit creates a `rangefeed.Filter` object, which informs the producer of logical operations of the information that a `rangefeed.Processor` is interested in, given its current set of registrations. It can be used to avoid performing extra work to provide the Processor with information which will be ignored. This is an important optimization for single-key or small key span rangefeeds, as it avoids some extraneous work for the key spans not being watched. For now, this extra work is just fetching the post-operation value for `MVCCWriteValueOp` and `MVCCCommitIntentOp` operations, but this can be extended in the future to include the pre-operation value as well. This will be important to avoid any perf regression when addressing #28666. 42580: sql: add precision support for TIMESTAMP/TIMESTAMPTZ (v2) r=otan a=otan Refs #32098 Alternative to #42552 ---- Add precision support for TIMESTAMP/TIMESTAMPTZ, supporting precisions from 0 to 6 inclusive. When storing this in the type proto, we introduce a `TimePrecisionIsSet` variable, which is used to differentiate 0 (unset) or 0 (explicitly set) for time related protos. This is abstracted away in the `Precision()` function which returns the correct precision (unset => 6) for time. This allows forwards and backwards compatibility. Note Time will come later, as it involves a bit more plumbing to the base library. Release note (sql change): Introduces precision support for TIMESTAMP and TIMESTAMPTZ, supporting precisions from 0 to 6 inclusive. Previous versions of TIMESTAMP and TIMESTAMPTZ will default to 6 units of precision. Note that if anyone downgrades whilst having precision set, they will have full precision (6) again, but if they re-upgrade they will find their precisions truncated again. Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com> Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
This fix has not made it into cockroachdb/cockroach:v19.1.6 / cockroachdb/cockroach:v2.1.10 or cockroachdb/cockroach:latest - all of which are producing the same error message :
|
As a matter of process, we don't backport features to previous releases - only bug fixes and (for 2 releases back) security fixes. This lack of support is not a bug. |
Is there a released (docker) version with this fix included ? |
I was told it would be included in 20.1 alpha back in december https://cockroachdb.slack.com/archives/CP4D9LD5F/p1575642161341500?thread_ts=1575633661.339600&cid=CP4D9LD5F |
Here is the 20.1 alpha with the docker information https://www.cockroachlabs.com/docs/releases/v20.1.0-alpha20191216.html |
Much appreciated @awoods187 |
@awoods187 - works like a charm with cockroachdb/cockroach-unstable:v20.1.0-alpha20191216 |
Just for the record - this fix is in |
sorry to break the spirit but that...should not be the case :o |
Because support for Could/should support be re-added in a way which avoids the issues that PR addresses? If so, should this issue be re-opened? Thanks! |
We actually fixed this for 20.1, our upcoming release. You can see it in this pr #42580 or in a beta here https://www.cockroachlabs.com/docs/releases/v20.1.0-beta.2.html |
Is your feature request related to a problem? Please describe.
CREATE TABLE t(x TIMESTAMP(6))
should workSee: https://www.postgresql.org/docs/11/static/datatype-datetime.html#DATATYPE-TIMEZONES
Describe the solution you'd like
MVP: An optional precision of 6 should be recognized and ignored (this is the default in CockroachDB)
Optionally: support for other precisions than 6.
Workaround
If the desired precision is 6, then the precision can be omitted altogether to obtain equivalent behavior.
The text was updated successfully, but these errors were encountered: