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

Add support for specifying timestamp precision using standard modifiers #5848

Merged
merged 3 commits into from
Jan 7, 2023

Conversation

Mytherin
Copy link
Collaborator

@Mytherin Mytherin commented Jan 7, 2023

This PR adds support for specfiying TIMESTAMP precision using the standard type modifier syntax, e.g.:

CREATE TABLE ts_precision(
	sec TIMESTAMP(0),
	msec TIMESTAMP(3),
	micros TIMESTAMP(6),
	nanos TIMESTAMP (9)
);

We only support seconds, milliseconds, microseconds and nanoseconds - i.e. 0, 3, 6 and 9. Other modifiers are rounded up, i.e. TIMESTAMP(1) will be turned into TIMESTAMP(3) (ms).

Only modifiers until nanoseconds (9) are supported. Higher modifiers will throw an exception.

@Mytherin Mytherin merged commit 45de9af into duckdb:master Jan 7, 2023
@Mytherin Mytherin deleted the timestampprecision branch February 16, 2023 14:42
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.

None yet

1 participant