Shavonne Marietta Wijesinghe wrote: > thanks. I read the page you gave. > > CREATE SEQUENCE seq_mytable_n_gen; > > CREATE TABLE mytable > ( > n_gen int nextval('seq_mytable_n_gen'), > mycolumn1 int, > mycolumn2 int > ); > > > i tried creating it like that. The sequence was created without any > error. But for the create table i get > > ERROR: syntax error at or near "nextval" at character 38 > > What should i do?
Add the missing "default": CREATE TABLE mytable ( n_gen int DEFAULT nextval('seq_mytable_n_gen'), mycolumn1 int, mycolumn2 int ); -- Milen A. Radev ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate