Forum: Ruby on Rails migration with PostgreSQL - function nextval does not exist

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kamil Kukura (Guest)
on 2006-02-09 08:53
(Received via mailing list)
This might be a problem with postgresql, but I'm not sure. In a
migration I have renamed a table so I wanted to rename a sequencer as
well. It looks like:

execute "ALTER TABLE global_vacations_id_seq RENAME TO
vacations_id_seq;"
execute "ALTER TABLE vacations ALTER COLUMN id SET DEFAULT
nextval('vacations_id_seq'::regclass);"

But the process of migration has reported error:
PGError: ERROR:  function nextval(regclass) does not exist

Funny part is that running "rake migrate" once again didn't give this
error again. It also has crashed, but because of errors from having the
migration already ran only on half of file. Anyone has experienced
something like this?

--
Kamil
Lugovoi Nikolai (Guest)
on 2006-02-09 09:19
(Received via mailing list)
postgresql before 8.1 does not have function nextval(regclass),
 but  nextval( text).
This topic is locked and can not be replied to.