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

Not working when used to_timestamp on foreign table column #127

Open
ilesh21190 opened this issue Jun 19, 2019 · 2 comments
Open

Not working when used to_timestamp on foreign table column #127

ilesh21190 opened this issue Jun 19, 2019 · 2 comments

Comments

@ilesh21190
Copy link

I have 2 columns inside my mongo which store dates in milliseconds,

createdAt double precision
updateAt double precision

when I try to extract year from it, I am getting below results

select to_timestamp("updateAt"/1000) , to_timestamp("createdAt"/1000),
"updateAt","createdAt", to_timestamp(COALESCE("updateAt","createdAt")/1000)  
from subscriptions_fdw where _id = '57a962f80e2e27d424cda3f3';

updatedDate     |        createdDate          | updatedAt     |   createdAt   |        Coalesce
--------------+----------------------------+-----------+---------------+----------------------------
                | 2016-08-06 11:12:39.476+00   |               | 1470481959476 | 2016-08-06 11:12:39.476+00

Here I am getting expected results, but if I do not add "updateAt","createdAt" and only add to_timestamp conversations, then I am getting NULL for all results,

 select to_timestamp("updateAt"/1000) , 
to_timestamp("createdAt"/1000), 
to_timestamp(COALESCE("updateAt","createdAt")/1000)  
from subscriptions_fdw where _id = '57a962f80e2e27d424cda3f3';

 to_timestamp | to_timestamp | to_timestamp
--------------+--------------+-----------+--------------
              |              |     

any help how to fix this will be really appreciated.

@iosifnicolae2
Copy link

iosifnicolae2 commented Jun 14, 2022

cc #162

@vaibhavdalvi93
Copy link

Thanks, @iosifnicolae2 and @ilesh21190 for reporting an issue.

We have fixed similar issues (#133) which resolved this issue as well.
Kind request to recheck at your end with latest HEAD before closing the same.
Please feel free to post an issue, if any.

The issue #162 is different issue and not related to this one.

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

No branches or pull requests

3 participants