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 week function on PostgreSQL backend #675

Closed
andyquinterom opened this issue Jul 6, 2021 · 1 comment · Fixed by #813
Closed

Add support for week function on PostgreSQL backend #675

andyquinterom opened this issue Jul 6, 2021 · 1 comment · Fixed by #813

Comments

@andyquinterom
Copy link

Add support for week function to be translated in PostgreSQL backend. This should be fairly easy to do since PostgreSQL has a native implementation of this.

As specified in Postgres documentation, we can extract the week from a Date column with the following:

SELECT EXTRACT(WEEK FROM TIMESTAMP '2001-02-16 20:38:40');
Result: 7

We can easily implement this directly into the backend.

andyquinterom added a commit to andyquinterom/dbplyr that referenced this issue Jul 6, 2021
Signed-off-by: andres <afquinteromoreano@gmail.com>
@mgirlich
Copy link
Collaborator

mgirlich commented Apr 5, 2022

I added a PR for this. Note that SELECT EXTRACT(WEEK FROM TIMESTAMP '2001-02-16 20:38:40'); is not the equivalent of week() but of isoweek().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants