I just switched from using a column type of SERIAL to trying to use a
Postgres Sequence defined as:
CREATE SEQUENCE unique_sequence START 101;
The column definition went from “id SERIAL NOT NULL” to
"id INTEGER NOT NULL DEFAULT nextval(‘unique_sequence’), "
When i insert outside of rails, everything works fine. Inside rails,
however, I get this error message:
ERROR C42P01 Mrelation “project_id_seq” does not
exist Fnamespace.c L201 RRangeVarGetRelid
My question is: Do you have to use Serial types on id columns? I would
prefer to use a sequence so i can ensure that the ids of rows in
several tables are entirely unique.