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

bug(expr): support timezone in to_jsonb interface #14610

Open
KeXiangWang opened this issue Jan 16, 2024 · 2 comments
Open

bug(expr): support timezone in to_jsonb interface #14610

KeXiangWang opened this issue Jan 16, 2024 · 2 comments
Assignees
Labels
no-issue-activity type/bug Something isn't working
Milestone

Comments

@KeXiangWang
Copy link
Contributor

KeXiangWang commented Jan 16, 2024

Describe the bug

Currently, the impementation of ToJsonb interface does not consider timezone.

One example:

set TimeZone to 'America/New_York';
select to_jsonb('2024-01-01 00:00:00'::timestamptz);
# expected (DST)
"2024-01-01T00:00:00-05:00"
# RW's output
"2024-01-01T00:00:00+00:00"

The mismatch was introduced when we implement ToJsonb interface.

The fix is simple. We can simply implement the new function with #[captured_context(TIME_ZONE)] and without large modification.

The problem is back compatibility. As the old implementation and the new implementation shared the same signature, it would be hard to distinguish. If there were old data using the old implementation and also the data executed with the new implementation, inconsistency may emerge.

Two possible solution:

  1. If we find the running Fragment's version is older than a release version, we throw errors and ask users to recreate the MV.
  2. Add new singnatures like to_jsonb1 jsonb_agg1 and jsonb_object_agg1. Newly created MV will be always binded to the new singnatures.
@KeXiangWang KeXiangWang added the type/bug Something isn't working label Jan 16, 2024
@github-actions github-actions bot added this to the release-1.7 milestone Jan 16, 2024
@KeXiangWang
Copy link
Contributor Author

Temporarily blocked by #14678

Copy link
Contributor

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants