>
> Or am I supposed to use
>
> id int default nextval('users_id_seq') ?
>
> Am I right?
>
> I thought Postgres adaptor will handle it by itself, but I didn't find
> in in the source code.
id must have a default nextval. The postgres adapter will deduce it if you
provide it.
Defining your tables with
id serial primary key
is the typical idiom.
Well, I read the source code of ActiveRecord::Base and the postgres-pr
adaptor and found out that the deduction you are referring to works
only for figuring out the id of the record just created:
Well, that's ok, I'm fine with the rdbms taking care of incrementing
the pk, I just had false expectations about Active Record, because in
some O/R Mappers I used in the past (OJB) you can configure it to take
care of the PKs.
Well, problem's solved, no, there's no problem, I'm pretty happy with
ActiveRecord.