From: | <operationsengineer1(at)yahoo(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Integer Question - Does Limit Value Make Sense |
Date: | 2006-11-25 19:32:34 |
Message-ID: | 480403.72458.qm@web33315.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
hi all,
i'm trying to work my through Agile Webdev with Rails.
unfortunately (for me, anyway!), they went with mysql
as their base db.
i'm trying to work through the code on my own using
pgsql.
i ran into a problem in their migration script (update
db script).
they use code as follows:
add_column :products, :price, :decimal, :precision =>
8, :scale => 2, :default => 0
you can get the gist of what they are doing with the
code.
i installed a plugin that let's me use integers to
handle the money portion, but this didn't work:
add_column :products, :price_in_cents, :integer,
:limit => 10, :default => 0, :null => false
due the following error:
PGError: ERROR: syntax error at or near "(" at
character 48
: ALTER TABLE products ADD price_in_cents integer(10)
it looks to me like it choked on the format
"integer(10)" part.
is limit a mysql specific issue for integer? it was
suggested on irc, but i think the guy is used to
mysql.
tia...
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-11-25 20:10:07 | Re: Integer Question - Does Limit Value Make Sense |
Previous Message | Richard Broersma Jr | 2006-11-24 21:04:34 | Re: Data (Table) Structure Question |