Skip to content

Cannot get Timespec #121

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

Closed
veer66 opened this issue May 8, 2015 · 2 comments
Closed

Cannot get Timespec #121

veer66 opened this issue May 8, 2015 · 2 comments

Comments

@veer66
Copy link

veer66 commented May 8, 2015

I try to read TIMESTAMP WITH TIME ZONE. I defined t as Timespec. I have already extern crate time; and use time::Timespec;

but I still get this error message:

the trait postgres::types::FromSql is not implemented for the type time::Timespec [E0277]
updated_time:row.get("created_time"),

@sfackler
Copy link
Owner

sfackler commented May 8, 2015

You need to enable the time feature to activate the FromSql and ToSql implementations for Timespec: https://github.com/sfackler/rust-postgres#timestamptimestamptz-types

@veer66
Copy link
Author

veer66 commented May 11, 2015

Thank you. I just notice how to enable feature in Cargo.toml.

postgres = {version="0.8.8", features=["time"]}

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

2 participants