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

CURRENT_DATE incorrectly deparsed in SELECT queries #231

Closed
citus-github-bot opened this issue Feb 4, 2016 · 5 comments
Closed

CURRENT_DATE incorrectly deparsed in SELECT queries #231

citus-github-bot opened this issue Feb 4, 2016 · 5 comments
Labels

Comments

@citus-github-bot
Copy link

Issue by trifthen
Thursday Mar 12, 2015 at 18:48 GMT
Originally opened as citusdata/pg_shard#85


When submitting a query to a worker node that contains CURRENT_DATE, the term is translated to ('now'::cstring)::date which produces the following error on the worker nodes:

ERROR:  cannot cast type cstring to date at character 84
STATEMENT:  SELECT NULL::unknown FROM ONLY sys_order_10130 WHERE (order_dt >= (('now'::cstring)::date - '7 days'::interval))

Steps to reproduce

After installing from a current git clone:

CREATE TABLE sys_order
(
    order_id     INT        PRIMARY KEY,
    product_id   INT        NOT NULL,
    item_count   INT        NOT NULL,
    order_dt     DATE       NOT NULL
);

SELECT master_create_distributed_table('sys_order', 'order_id');
SELECT master_create_worker_shards('sys_order', 16, 2);

INSERT INTO sys_order VALUES (1, 2, 3, '2015-03-12');

SELECT COUNT(1) FROM sys_order
WHERE order_dt >= CURRENT_DATE - INTERVAL '7 days';
@citus-github-bot citus-github-bot added this to the Next milestone Feb 4, 2016
@citus-github-bot
Copy link
Author

Comment by jasonmp85
Friday Mar 13, 2015 at 22:42 GMT


Thanks for the clear bug report and copy-paste repro case! One more thing for posterity's sake: what version of PostgreSQL were you testing this against?

@citus-github-bot
Copy link
Author

Comment by trifthen
Saturday Mar 14, 2015 at 18:07 GMT


This was a 9.4.1 release from the PGDG PostgreSQL Apt repo.

@citus-github-bot
Copy link
Author

Comment by jasonmp85
Thursday Sep 03, 2015 at 05:11 GMT


This will be closed by #224 (manually updated issue number)

@ozgune
Copy link
Contributor

ozgune commented Mar 16, 2016

#64 could be related to this issue.

@marcocitus
Copy link
Member

This seems to get deparsed correctly.

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

No branches or pull requests

4 participants