I''m working on a patch to Rails 2.0.2 to address a cartesian join with PG_namespace in activerecord-2.0.2/lib/active_record/ connection_adapters/postgresql_adapter.rb. (around line 559 or so). What I''m wondering is this: did the original author intend to retrieve the namespace (schema) for the database object (the sequence that feeds the primary key, in this case), and if so, what was the reason? Its probably a good one, and I''d like the patch to do the necessary in the correct fashion. The current query doesn''t return the schema name, so I''m thinking maybe it should, but Rails works fine without it, since the convention (!) is to have the table and sequence in the same schema namespace, which is in the login''s search path in PostgreSQL. As an old, crusty DBA/developer, I''d prefer to have a trigger populate the surrogate primary key, but I understand this is not the One True Rails Way, so I''m not going to fight it. (Not here, anyway. I''ll hack my own code to do what I think it needs to do.) Any thoughts? Please share... --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-25 14:45 UTC
Re: PG_Namespace cartesian join in postgresql_adapter.rb
On Apr 25, 3:39 pm, Bob <bob.lun...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m working on a patch to Rails 2.0.2 to address a cartesian join with > PG_namespace in activerecord-2.0.2/lib/active_record/ > connection_adapters/postgresql_adapter.rb. (around line 559 or so). >You might want to try this over on the rubyonrails-core mailing-list, it''s probably more appropriate in this case. Fred --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Will do, Fred. Thanks for the tip. Bob On Apr 25, 9:45 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 25, 3:39 pm, Bob <bob.lun...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m working on a patch to Rails 2.0.2 to address a cartesian join with > > PG_namespace in activerecord-2.0.2/lib/active_record/ > > connection_adapters/postgresql_adapter.rb. (around line 559 or so). > > You might want to try this over on the rubyonrails-core mailing-list, > it''s probably more appropriate in this case. > > Fred--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---