On Mar 24, 10:35 pm, EAMiller <[email protected]> wrote:
> er-ca=# alter SEQUENCE er_utility_id_seq OWNED BY er_utility, id;
> ERROR: syntax error at or near ","
> LINE 1: alter SEQUENCE er_utility_id_seq OWNED BY er_utility, id;
Sorry, my bad. er_utility, id should have been er_utility.id
> However, I'm not sure if your answer is based on the expectation that
> we've got a serial or bigserial id column. It's an integer - although
> as a colleague noted, if django 1.3 had created this table, it would
> have been a serial. I haven't found any upgrade notes that describe
> integer id columns as a problem.
I reported this to Trac, issue #15682.
id integer not null default nextval('er_utility_id_seq') is almost
like serial. From postgresql docs: [1]
CREATE TABLE tablename (
colname SERIAL
);
is equivalent to specifying:
CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename (
colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')
);
ALTER SEQUENCE tablename_colname_seq OWNED BY tablename.colname;
[1]
http://www.postgresql.org/docs/8.4/static/datatype-numeric.html#DATATYPE-SERIAL
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.