Prisma generating a NUMERIC(65, 30) for PostgreSQL, doesn't match docs
See original GitHub issuePrisma 2 migrate autogenerated a column of Prisma’s Float type as a PostgreSQL Numeric with a precision of 65 and a scale of 30.
- The documentation says that this should be a
realtype in PostgreSQL, not a numeric - Why is Prisma making such a precise column? This will result in massively more data consumption and will make calculations wildly slow compared to any other number type (see PostgreSQL documentation 8.1.2. Arbitrary Precision Numbers)
Edit:
The generated migration Markdown file says it was attempting to create a Decimal(65,30), which I believe is just an alias for the Numeric type.
Perhaps look through source code for that string?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Prisma generating a NUMERIC(65, 30) for PostgreSQL, doesn ...
Prisma 2 migrate autogenerated a column of Prisma's Float type as a PostgreSQL Numeric with a precision of 65 and a scale of...
Read more >Prisma schema API (Reference)
Describes which generator to use. This can point to a file that implements a generator or specify a built-in generator directly. output, No,...
Read more >PostgreSQL database connector (Reference) - Prisma
This page explains how Prisma can connect to a PostgreSQL database using the PostgreSQL database connector.
Read more >Schema Incompatibilities | PostgreSQL - Prisma
Prisma 1 auto-generates values for DateTime fields when they're annotated with the @createdAt directive. These values are generated by the Prisma 1 server...
Read more >PostgreSQL Data Types - Numeric, Text, and More - Prisma
The numeric type takes zero to two arguments. Specify precision followed by scale when configuring a column using both controls. PostgreSQL will round...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@molomby this is what we are planning. The decimal situation is an old workaround for client tests that will be cleaned up.
This is going to be indeed a breaking change we will have to carefully communicate to our users but we believe it’s for the best, because in the future we will be providing a better default. The way around the precision loss is indeed to introspect, which could be considered to some extent a codemod.