-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Handle TIMESTAMP
data type in the backend
#424
Comments
Timestamps data type cause a conflict with date type when inferring a There are two ways I can think of:
@mathemancer @kgodey @dmos62 Would like your opinion on this issue. |
For context (probably just for me), Postgres So this sounds like option 3. A quick note on terminology, casting a |
By lossy I mean there is no way to get back the data once it has been coerced. For example
The time data is lost upon downcasting to date and upcasting to a timestamp. |
I've already been thinking along the lines of option (3) above. I think we're eventually going to need to have different casting functions based on whether we're trying to infer a type or not. For now, I suggest using a custom function for casting that disallows lossy conversion (see the one for casting to integer, for example). We already have an issue #402 involving setting up default casting behavior when appropriate. Perhaps that could be the first step to an "advanced mode" that would allow lossy casting. |
Option 3 sounds fine to me. To confirm, this means that if we see both date and time information, we would infer it to be |
@kgodey Yes, that's right. |
This issue is to ensure that Mathesar can handle the Postgres
TIMESTAMP
data type.As part of this issue, we need to ensure that:
TIMESTAMP
(with time zone) if it's possible to do so.TIMESTAMP
(without time zone) if it's possible to do so.precision
of a givenTIMESTAMP
column via atype_options
field in the API.TIMESTAMP
when it makes sense to do so.Additional Context
v0/databases/
's types list to show both Mathesar and DB type information. #368 for code that calculates which types are allowed for a column.The text was updated successfully, but these errors were encountered: