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 : SELECT TIMESTAMP 'now'; not working #8105

Closed
abhyuday26 opened this issue Feb 21, 2023 · 2 comments
Closed

bug : SELECT TIMESTAMP 'now'; not working #8105

abhyuday26 opened this issue Feb 21, 2023 · 2 comments

Comments

@abhyuday26
Copy link

Describe the bug

As per #7686 we should get same result for these three queries

SELECT CURRENT_TIMESTAMP;
SELECT now();
SELECT TIMESTAMP 'now';

But we encounter below error

ERROR: QueryError: Expr error: Parse error: Can't cast string to timestamp (expected format is YYYY-MM-DD HH:MM:SS[.D+{up to 6 digits}] or YYYY-MM-DD HH:MM or YYYY-MM-DD or ISO 8601 format)

Support for above two queries was given in #7695

To Reproduce

It can be simply reproduced by running this query.
SELECT TIMESTAMP 'now';

Expected behavior

It should return the current timestamp.

         timestamp
----------------------------
 2023-02-21 19:26:33.361002
(1 row)

Additional context

No response

@abhyuday26 abhyuday26 added the type/bug Something isn't working label Feb 21, 2023
@github-actions github-actions bot added this to the release-0.1.18 milestone Feb 21, 2023
@xiangjinwu
Copy link
Contributor

Yes, TIMESTAMP 'now' is not implemented right now.

However, even though SELECT TIMESTAMP 'now';, SELECT now(); and SELECT CURRENT_TIMESTAMP; are expected to return the same result as a batch query, they have different meaning in (materialized) views. The TIMESTAMP 'now' form would be a constant equal to the time of view creation.

Let's treat this as a missing feature and decide whether we want to support it (and warn user) rather than a bug.
cc @neverchanje

@xiangjinwu xiangjinwu added type/feature and removed type/bug Something isn't working labels Mar 21, 2023
@xiangjinwu
Copy link
Contributor

xiangjinwu commented Mar 21, 2023

until a valid use case raised

@xiangjinwu xiangjinwu closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants