Postgres numeric
type should be a string in Json Output
#2596
-
Environment
Description of issueWhen querying a Postgrest
After using JSON.parse in Javascript I get, so precision is lost. Other javascript libraries that are able to parse large numbers are quite inefficient.
I think it would make sense to return a string instead, like.
Related Issue: supabase/cli#582 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
I think you should cast your column to text either in a view or in the query: https://postgrest.org/en/stable/api.html#casting-columns. |
Beta Was this translation helpful? Give feedback.
-
This should be considered a bug. Pydantic uses strings: https://docs.pydantic.dev/latest/api/standard_library_types/#decimaldecimal |
Beta Was this translation helpful? Give feedback.
I think you should cast your column to text either in a view or in the query: https://postgrest.org/en/stable/api.html#casting-columns.