You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: value too long for type character varying(6)
This error is created when you input a value more than 6 characters as its what you set in your init.sql file. You could either use MONEY data type or NUMERIC (see below for more info)
Postgres provides ways to store monetary data, the Numeric type, and its alias, Decimal. These types can store numbers with a very large number of digits, and yet perform calculations exactly.
Postgres also offers a dedicated Money type which stores currency amounts with a fixed fractional precision.
The input can take many forms including integers, floats, and even strings such as ‘$20.00’. The output is also automatically formatted as a currency value.
Error: value too long for type character varying(6)
week2-MCD-eBargain/database/init.sql
Line 28 in c2d7acf
Postgres provides ways to store monetary data, the Numeric type, and its alias, Decimal. These types can store numbers with a very large number of digits, and yet perform calculations exactly.
Postgres also offers a dedicated Money type which stores currency amounts with a fixed fractional precision.
The input can take many forms including integers, floats, and even strings such as ‘$20.00’. The output is also automatically formatted as a currency value.
For more information check out postgres docs on numeric types & money types
The text was updated successfully, but these errors were encountered: