-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: support optional TIME precision #32565
Copy link
Copy link
Closed
Labels
A-sql-datatypesSQL column types usable in table descriptors.SQL column types usable in table descriptors.A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)X-anchored-telemetryThe issue number is anchored by telemetry references.The issue number is anchored by telemetry references.
Description
Is your feature request related to a problem? Please describe.
CREATE TABLE t(x TIME(6)) should work
See: https://www.postgresql.org/docs/11/static/datatype-datetime.html#DATATYPE-TIMEZONES
time, timestamp, and interval accept an optional precision value p which specifies the number of fractional digits retained in the seconds field. By default, there is no explicit bound on precision. The allowed range of p is from 0 to 6.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-datatypesSQL column types usable in table descriptors.SQL column types usable in table descriptors.A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)X-anchored-telemetryThe issue number is anchored by telemetry references.The issue number is anchored by telemetry references.