Hello! I''m having the following error: RuntimeError: ERROR C42P01 Mrelation "subjects_users_id_seq" does not exist Fnamespace.c L200 RRangeVarGetRelid: SELECT currval (''subjects_users_id_seq'') when I try to do: subject= SubjectsUser.new(params[:subjects_user]) subject.save The models: class User < ActiveRecord::Base has_one :last_entrie has_one :address_book has_and_belongs_to_many :subjects has_one :user_detail has_and_belongs_to_many :subjects end class Subject < ActiveRecord::Base has_and_belongs_to_many :users belongs_to :subject_group end class SubjectsUser < ActiveRecord::Base end Thank you for your attention, Paulo Abreu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 01/09/06, Paulo Abreu <pama-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org> wrote:> > Hello! > > I''m having the following error: > > RuntimeError: ERROR C42P01 Mrelation "subjects_users_id_seq" does not > exist Fnamespace.c L200 RRangeVarGetRelid: SELECT currval > (''subjects_users_id_seq'')You''re using postgresql. It uses a ''serial'' field for each primary key. When it inserts a new row, it pulls the next ''id'' value from something called a sequence (basically, a counter). For some reason, the subjects_users_id_seq sequence isn''t there any more. You can recreate it - try ''\h create sequence'' from inside psql. If you have existing data in subjects_users, you need to make sure the sequence starts with a number 1 higher than the current highest value in the ''id'' field of subjects_users. -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
C:\Documents and Settings\Will\My Documents\src\mm\web\cgi-bin>processBounces.rb Connection Test Successful - Connected To The Database Parsing Logfile Finished Processing Bounces... select id, bounce from sql_languages where email=''mcvallejo82-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org''; c:/ruby/lib/ruby/site_ruby/1.8/DBD/Pg/Pg.rb:640:in `execute'': ERROR C42P01 Mrelation "sql_languages" does not exist Fnamespace.c L201 RRangeVa rGetRelid (DBI::ProgrammingError) from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:617:in `execute'' from C:/Documents and Settings/Will/My Documents/src/mm/web/cgi-bin/proc essBounces.rb:84:in `updateBounceCount'' from C:/Documents and Settings/Will/My Documents/src/mm/web/cgi-bin/proc essBounces.rb:79:in `updateBounceCount'' from C:/Documents and Settings/Will/My Documents/src/mm/web/cgi-bin/proc essBounces.rb:144 from C:/Documents and Settings/Will/My Documents/src/mm/web/cgi-bin/proc essBounces.rb:142 Roughly the same issue, but it doesn''t seem to be an issue with the serial.... any ideas? The code is as follows: data_sources.each do |table_name| email_address = email_address.downcase selectQry = "select id, bounce from "+table_name+" where email=\''"+email_address+"\''\;" sth = dbh.prepare(selectQry) sth.execute while rows = sth.fetch do printf rows[0], rows[1],"\n" end end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---