Every page of my DEPOT on Postgresql rails app now gets an error from postgres-pr about some wild left-join SQL that has nothing to do with my tables: SQL (0.000000) NameError: undefined local variable or method `errors'' for #<PostgresPR::Connection:0x3b200c0>: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = ''line_items''::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum Any idea where the wild sql comes from ? If I stop everything and swap out the database.yml so it points to the msysql database, and restart, it works fine as before. Win xpsp2, ruby 1.8.4, rails 1.1.2, postgres-pr (0.4.0) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060429/94ca81db/attachment.html
I''m quite sure it''s part of ActiveRecord''s auto discovery process. Won''t happen nearly as often in production mode. :-) -- -- Tom Mornini On Apr 29, 2006, at 1:16 PM, Warren Seltzer wrote:> Every page of my DEPOT on Postgresql rails app now gets an error > from postgres-pr about some wild left-join SQL that has nothing to > do with my tables: > > SQL (0.000000) NameError: undefined local variable or method > `errors'' for #<PostgresPR::Connection:0x3b200c0>: SELECT a.attname, > format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull > FROM pg_attribute a LEFT JOIN pg_attrdef d > ON a.attrelid = d.adrelid AND a.attnum = d.adnum > WHERE a.attrelid = ''line_items''::regclass > AND a.attnum > 0 AND NOT a.attisdropped > ORDER BY a.attnum > > Any idea where the wild sql comes from ? If I stop everything and > swap out the database.yml so it points to the msysql database, and > restart, it works fine as before. > Win xpsp2, ruby 1.8.4, rails 1.1.2, postgres-pr (0.4.0) > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I''ll damn make sure that bug doesn''t get into production mode. Okay then. Any ideas on how to fix it? Any ideas at all? Please? A wee little hint? Warren Seltzer -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Tom Mornini Sent: Sunday, April 30, 2006 12:27 AM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Wild SQL -- public/500.html -- postgres-pr I''m quite sure it''s part of ActiveRecord''s auto discovery process. Won''t happen nearly as often in production mode. :-) -- -- Tom Mornini
Why do you think it''s a bug? ActiveRecord needs to know about the schema in order to do it''s magic. In production, it does this each time. This allows you to add columns to your DB and not restart everything. In production, it assumes the schema won''t be changing, so it only needs to do this once. -- -- Tom Mornini On May 3, 2006, at 4:37 AM, Warren Seltzer wrote:> I''ll damn make sure that bug doesn''t get into production mode. > Okay then. Any ideas on > how to fix it? Any ideas at all? Please? A wee little hint? > > Warren Seltzer > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org [mailto:rails- > bounces@lists.rubyonrails.org] On > Behalf Of Tom Mornini > Sent: Sunday, April 30, 2006 12:27 AM > To: rails@lists.rubyonrails.org > Subject: Re: [Rails] Wild SQL -- public/500.html -- postgres-pr > > > I''m quite sure it''s part of ActiveRecord''s auto discovery process. > > Won''t happen nearly as often in production mode. :-) > > -- > -- Tom Mornini > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I didn''t recognize it as schema-finding sql. It looked loopy and was crashing my rails app. Postgresql was rejecting it for some reason other than it''s apparent loopiness which fooled me -- it was actually a failure of the C connector on winxp, not postgresql or rails. Warren Seltzer -----Original Message----- From: Tom Mornini [mailto:tmornini@infomania.com] Sent: Wednesday, May 03, 2006 7:31 PM To: warrens@actcom.net.il; rails@lists.rubyonrails.org Subject: Re: [Rails] Wild SQL -- public/500.html -- postgres-pr Why do you think it''s a bug? ActiveRecord needs to know about the schema in order to do it''s magic. In production, it does this each time. This allows you to add columns to your DB and not restart everything. In production, it assumes the schema won''t be changing, so it only needs to do this once. -- -- Tom Mornini
Seemingly Similar Threads
- actionmailer the background
- Help with Rails and postgres with sequence numbers (global?)
- [error] avahi_entry_group_add_service_strlst("AdminNodeFQDN") failed: Invalid host name
- RSpec and PostgreSQL not playing nicely together
- My database model''s connection appears messed up.