dca*_*xto 3 ruby database postgresql ruby-on-rails ruby-on-rails-3
我的架构上有一个十进制字段的价格,每次我尝试插入价格时,pg都带有此错误.谁能给我任何光?谢谢
组态
t.decimal "price", :precision => 2, :scale => 2
Run Code Online (Sandbox Code Playgroud)
错误
PG::Error: ERROR: numeric field overflow
DETAIL: A field with precision 2, scale 2 must round to an absolute value less than 1.
: INSERT INTO "items" ("category_id", "name", "price", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) RETURNING "id"
Run Code Online (Sandbox Code Playgroud)