-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
unsupported type MONEY in macros with Postgres #1206
Comments
Using the |
@IdemenB for the macros to support
That's... complicated. It was deprecated in old versions but it no longer is. Here's the author of the type weighing in (also talking about how the parsing from the text format is pretty sloppy): https://www.postgresql.org/message-id/flat/20130328092819.237c0106@imp#20130328092819.237c0106@imp
The reply also explains some cases where you don't want to use it:
Certainly if you do choose it, you need to be keenly aware of its limitations, but to say it's a "horrible idea" is hyperbole. |
|
First, I still contend this is deprecated and provides no real advantage. There is no reason to ever use this over |
The If you want to use the money type in macros today, all that would need to be done is I also am firmly against the idea of the money type. It's about as bad as using the timestamp type (over timestamptz). Either store it as a numeric or store it as an integer of the lowest denomination. However, SQLx tries to not have an opinion for things like this. |
Closed by #1218 |
Running a query on a Postgres DB table with a field of MONEY type gives the following error with the query_as! macro. This happens despite the fact that the related field in the Struct field is set as "PgMoney" documented in https://docs.rs/sqlx/0.5.2/sqlx/postgres/types/struct.PgMoney.html.
unsupported type MONEY of column #5 ("paymentamount")
Am I missing something here?
The text was updated successfully, but these errors were encountered: