I have a simple project created around a very, very simple database: one main table packs with just three rows Column | Type | Modifiers --------+-----------------------------+---------------------------------------------------- id | integer | not null default nextval(''packs_id_seq''::regclass) nombre | character varying(40) | path | character varying(250) | in a method I have : id = params[:album].to_i @album = Pack.find id That is the sentence located using debugger. The answer in the browser: ActiveRecord::StatementInvalid in FotosController#inic PGError: ERROR: zero-length delimited identifier at or near """" LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... ^ : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 It used to work with rails 2. What happened ? Gato Pardo -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi! It seems like the id variable is nil. Could you check this? Best Regards, Everaldo On Sat, Sep 17, 2011 at 10:25 PM, gato pardo <gato.pardo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a simple project created around a very, very simple database: one > main table packs with just three rows > Column | Type | > Modifiers > > --------+-----------------------------+---------------------------------------------------- > id | integer | not null default > nextval(''packs_id_seq''::regclass) > nombre | character varying(40) | > path | character varying(250) | > > in a method I have : > id = params[:album].to_i > @album = Pack.find id > That is the sentence located using debugger. The answer in the browser: > ActiveRecord::StatementInvalid in FotosController#inic > > PGError: ERROR: zero-length delimited identifier at or near """" > LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... > ^ > : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 > > It used to work with rails 2. What happened ? > > Gato Pardo > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Everaldo: but I have already checked the id variable value by changing: @album = Pack.find id to @album = Pack.find 1 the result is the same. I wonder if someone has noticed some bug with the pg gem. I do not have any other explanation so far. Gato Pardo =================================================On Sat, Sep 17, 2011 at 9:40 PM, Everaldo Gomes <everaldo.gomes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hi! > > It seems like the id variable is nil. > Could you check this? > > Best Regards, > Everaldo > > > On Sat, Sep 17, 2011 at 10:25 PM, gato pardo <gato.pardo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I have a simple project created around a very, very simple database: one >> main table packs with just three rows >> Column | Type | >> Modifiers >> >> --------+-----------------------------+---------------------------------------------------- >> id | integer | not null default >> nextval(''packs_id_seq''::regclass) >> nombre | character varying(40) | >> path | character varying(250) | >> >> in a method I have : >> id = params[:album].to_i >> @album = Pack.find id >> That is the sentence located using debugger. The answer in the browser: >> ActiveRecord::StatementInvalid in FotosController#inic >> >> PGError: ERROR: zero-length delimited identifier at or near """" >> LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... >> ^ >> : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 >> >> It used to work with rails 2. What happened ? >> >> Gato Pardo >> >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 18 September 2011 02:25, gato pardo <gato.pardo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a simple project created around a very, very simple database: one > main table packs with just three rows > Column | Type | > Modifiers > > --------+-----------------------------+---------------------------------------------------- > id | integer | not null default > nextval(''packs_id_seq''::regclass) > nombre | character varying(40) | > path | character varying(250) | > > in a method I have : > id = params[:album].to_i > @album = Pack.find id > That is the sentence located using debugger. The answer in the browser: > > ActiveRecord::StatementInvalid in FotosController#inic > > PGError: ERROR: zero-length delimited identifier at or near """" > LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... > ^ > : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1What happens if, in the rails console, you type Pack.find 1 Paste the result here. Also show us db/schema.rb Colin -- gplus.to/clanlaw -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> What happens if, in the rails console, you type > Pack.find 1 > > Paste the result here. > Also show us db/schema.rb > > Colin > -- > gplus.to/clanlaw > > Thanks Colin:1.- Results with Pack.find 1 "irb(main):001:0> Pack.find 1 Could not log "sql.active_record" event. NoMethodError: undefined method `name'' for nil:NilClass PGError: ERROR: zero-length delimited identifier at or near """" LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... ^ : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 ActiveRecord::StatementInvalid: PGError: ERROR: zero-length delimited identifier at or near """" LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... ^ : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in `prepare'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in `exec_cache'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:552:in `exec_query'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `log'' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in `instrument'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in `exec_query'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1031:in `select'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in `select_all'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:470:in `find_by_sql'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation.rb:111:in `to_a'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:370:in `find_first'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:122:in `first'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:328:in `find_one'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:304:in `find_with_ids'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:107:in `find'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:441:in `__send__'' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:441:in `find'' " 2.- I do not have a file db/schema.rb. I am just using my database through config/database.yml. Gato Pardo -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 18 September 2011 10:29, gato pardo <gato.pardo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> [...] > 1.- Results with Pack.find 1 > > "irb(main):001:0> Pack.find 1 > Could not log "sql.active_record" event. NoMethodError: undefined method > `name'' for nil:NilClass > PGError: ERROR: zero-length delimited identifier at or near """" > LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... > ^ > : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 > ActiveRecord::StatementInvalid: PGError: ERROR: zero-length delimited > identifier at or near """" > LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... > ^ > : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in > `prepare'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in > `exec_cache'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:552:in > `exec_query'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in > `log'' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in > `instrument'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:239:in > `log'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in > `exec_query'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1031:in > `select'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in > `select_all'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in > `select_all'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:470:in > `find_by_sql'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation.rb:111:in > `to_a'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:370:in > `find_first'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:122:in > `first'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:328:in > `find_one'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:304:in > `find_with_ids'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:107:in > `find'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:441:in > `__send__'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:441:in > `find'' > " > > 2.- I do not have a file db/schema.rb. > I am just using my database through config/database.yml.Well you should have, you should have used rails migrations to create the db, unless this is a legacy database. Create schema.rb by running rake db:schema:dump and post it here, though whether this is anything to do with the problem is unlikely. Colin -- gplus.to/clanlaw -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 18 September 2011 10:35, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 18 September 2011 10:29, gato pardo <gato.pardo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> [...] >> 1.- Results with Pack.find 1 >> >> "irb(main):001:0> Pack.find 1 >> Could not log "sql.active_record" event. NoMethodError: undefined method >> `name'' for nil:NilClass >> PGError: ERROR: zero-length delimited identifier at or near """" >> LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... >> ^ >> : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 >> ActiveRecord::StatementInvalid: PGError: ERROR: zero-length delimited >> identifier at or near """" >> LINE 1: SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT ... >> ^ >> : SELECT "packs".* FROM "packs" WHERE "packs"."" = $1 LIMIT 1 >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in >> `prepare'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in >> `exec_cache'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:552:in >> `exec_query'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in >> `log'' >> from >> /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in >> `instrument'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:239:in >> `log'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in >> `exec_query'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1031:in >> `select'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in >> `select_all'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in >> `select_all'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:470:in >> `find_by_sql'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation.rb:111:in >> `to_a'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:370:in >> `find_first'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:122:in >> `first'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:328:in >> `find_one'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:304:in >> `find_with_ids'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/relation/finder_methods.rb:107:in >> `find'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:441:in >> `__send__'' >> from >> /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/base.rb:441:in >> `find'' >> " >> >> 2.- I do not have a file db/schema.rb. >> I am just using my database through config/database.yml. > > Well you should have, you should have used rails migrations to create > the db, unless this is a legacy database. Create schema.rb by running > rake db:schema:dump > and post it here, though whether this is anything to do with the > problem is unlikely.Also post model/pack.rb please. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>> > Well you should have, you should have used rails migrations to create > > the db, unless this is a legacy database. Create schema.rb by running > > rake db:schema:dump > > and post it here, though whether this is anything to do with the > > problem is unlikely. > > Also post model/pack.rb please. > > Colin >> Thanks Colin for your fast answer and your care. >I just created schema.rb. Here I send its content:> -------------------------------------------------------------- > > ActiveRecord::Schema.define(:version => 20110110162357) do > > create_table "packs", :id => false, :force => true do |t| > t.integer "id", :null => false > t.string "nombre", :limit => 40 > t.string "path", :limit => 250 > end > > create_table "sessions", :force => true do |t| > t.string "session_id", :null => false > t.text "data" > t.datetime "created_at" > t.datetime "updated_at" > end > > add_index "sessions", ["session_id"], :name => > "index_sessions_on_session_id" > add_index "sessions", ["updated_at"], :name => > "index_sessions_on_updated_at" > > end > -------------------------------------------------------------- >2.- The content of model/pack.rb -------------------------------------------------------------- class Pack < ActiveRecord::Base def self.lisapp res = self.find :all ar = [] res.each { |arap| ar << [arap[1], arap[0]] } ar.sort end end -------------------------------------------------------------- The method lisapp is not used any more. Instead I use, before the error is generated @albums = Pack.find :all and it works. Problem is with : Pack.find 1 ( or id) Gato Pardo -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 18 September 2011 11:13, gato pardo <gato.pardo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:>> >> >> > Well you should have, you should have used rails migrations to create >> > the db, unless this is a legacy database. Create schema.rb by running >> > rake db:schema:dump >> > and post it here, though whether this is anything to do with the >> > problem is unlikely. >> >> Also post model/pack.rb please. >> >> Colin > > >> >> Thanks Colin for your fast answer and your care. > > I just created schema.rb. Here I send its content: > >> >> -------------------------------------------------------------- >> >> ActiveRecord::Schema.define(:version => 20110110162357) do >> >> create_table "packs", :id => false, :force => true do |t| >> t.integer "id", :null => false >> t.string "nombre", :limit => 40 >> t.string "path", :limit => 250 >> end >> >> create_table "sessions", :force => true do |t| >> t.string "session_id", :null => false >> t.text "data" >> t.datetime "created_at" >> t.datetime "updated_at" >> endNotice how the spec for id is different between the two tables, I suppose that is due to the fact that you are providing your own nextval for id (there is no spec for it in sessions so rails will assume the default id column). I suspect this may be the cause of the problem. First I suggest reverting id to a normal id column as you have for sessions and see if this removes the problem. If it does then either don''t use the nextval feature or you will have to ask others whether it is possible to do this and if so whether you are doing it correctly. I strongly advise against doing this, life will be much simpler if you stick to the rails conventions. Possibly you can find another way to achieve what you want, maybe by adding another column for your alternative id. Colin -- gplus.to/clanlaw -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> > Notice how the spec for id is different between the two tables, I > suppose that is due to the fact that you are providing your own > nextval for id (there is no spec for it in sessions so rails will > assume the default id column). I suspect this may be the cause of the > problem. First I suggest reverting id to a normal id column as you > have for sessions and see if this removes the problem. If it does > then either don''t use the nextval feature or you will have to ask > others whether it is possible to do this and if so whether you are > doing it correctly. I strongly advise against doing this, life will > be much simpler if you stick to the rails conventions. Possibly you > can find another way to achieve what you want, maybe by adding another > column for your alternative id. > > Colin > >Thanks a lot Colin: I did, literarily as you suggested, and I do not have that ugly error with "Packfind id" any more. I do have another problem, that comes from changes in rails version, but I''ll Google before starting any new thread. Thanks, once again. Gato Pardo -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.