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

sql,builtins: support to_char formatting builtins for timestamp and interval #91156

Closed
rafiss opened this issue Nov 2, 2022 · 2 comments · Fixed by #91382
Closed

sql,builtins: support to_char formatting builtins for timestamp and interval #91156

rafiss opened this issue Nov 2, 2022 · 2 comments · Fixed by #91382
Assignees
Labels
A-sql-builtins SQL built-in functions and semantics thereof. A-sql-pgcompat Semantic compatibility with PostgreSQL A-tools-aws-dms Blocking support for AWS Database Migration Service C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@rafiss
Copy link
Collaborator

rafiss commented Nov 2, 2022

We should support the following builtins for compatibility with Postgres. They allow timestamps and intervals to be formatted with a custom format.

 to_char(timestamp, text)
 to_char(interval, text)

https://www.postgresql.org/docs/current/functions-formatting.html

Spun off #3781

The goal is to support our DMS integration. So we could limit our first implementation to have only the features that DMS needs. Talk to @otan about this.

Jira issue: CRDB-21127

Epic CRDB-17785

@rafiss rafiss added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-builtins SQL built-in functions and semantics thereof. labels Nov 2, 2022
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Nov 2, 2022
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Nov 2, 2022
@rafiss rafiss added the A-tools-aws-dms Blocking support for AWS Database Migration Service label Nov 2, 2022
@otan
Copy link
Contributor

otan commented Nov 2, 2022

note: ideally we copy the implementation of https://github.com/postgres/postgres/blob/d54e79ba282c6a86d0c63e990e716b2c07a8656d/src/backend/utils/adt/formatting.c#L4045 directly to avoid pg compat issues.

@otan
Copy link
Contributor

otan commented Nov 6, 2022

format required for DMS: YYYY-MM-DD HH24:MI:SS.US

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-builtins SQL built-in functions and semantics thereof. A-sql-pgcompat Semantic compatibility with PostgreSQL A-tools-aws-dms Blocking support for AWS Database Migration Service C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants