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

Type Cast Parentheses Problem #152

Merged
merged 3 commits into from
Nov 11, 2019
Merged

Conversation

emin100
Copy link
Contributor

@emin100 emin100 commented Jul 30, 2019

Query:
SELECT * FROM kodsis WHERE create_date BETWEEN (CURRENT_DATE - 5)::DATE AND CURRENT_DATE

Deparser Result:
SELECT * FROM kodsis WHERE create_date BETWEEN CURRENT_DATE - 5::DATE AND CURRENT_DATE

Result is not same the original query. I fixed it.

New Deparser Result:
SELECT * FROM kodsis WHERE create_date BETWEEN (CURRENT_DATE - 5)::date AND CURRENT_DATE

mehmet emin karakas added 3 commits July 1, 2019 14:26
CREATE DOMAIN us_postal_code AS TEXT
CHECK(
   VALUE ~ '^\d{5}$'
OR VALUE ~ '^\d{5}-\d{4}$'
);
Query:
SELECT * FROM kodsis WHERE create_date BETWEEN (CURRENT_DATE - 5)::DATE AND CURRENT_DATE

Deparser Result:
SELECT * FROM kodsis WHERE create_date BETWEEN CURRENT_DATE - 5::DATE AND CURRENT_DATE

Result is not same the original query. I fixed it.

New Deparser Result:
SELECT * FROM kodsis WHERE create_date BETWEEN (CURRENT_DATE - 5)::date AND CURRENT_DATE
@lfittl lfittl merged commit 4fa328e into pganalyze:master Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants