On Tuesday, June 2, 2015 at 7:26:50 AM UTC-7, mamesaye kane wrote:
>
> I have this connection :
> OLD_DB = Sequel.connect(:adapter=>'postgres', :host=>'localhost', :
> database=> 'newscold', :user=>'USERNAME', :password=>'PASSWORD', :search_path
> => "sitecontent,public")
>
>
> and this query:
>
> nc_items = OLD_DB.fetch("select count(*) from items i left join item_sites
> iis on i.id = iis.item_id left join sites s on iis.site_id = s.id " )
>
> puts "the number of newscold items that will be migrated is
> :#{nc_items.first[:count]}"
>
> This give me this error:
> ruby script/import_data_from_newscold_db.rb/home/user/.rvm/gems/ruby-2.0.0
> -p643/gems/sequel-4.22.0/lib/sequel/adapters/postgres.rb:180:in `async_exec':
> PG::UndefinedTable: ERROR: relation "items" does not exist
> (Sequel::DatabaseError)LINE 1: SELECT * FROM "items" INNER JOIN
> "item_sites" ON ("item_site...
>
>
> on rails console i check for the connection. I have :
>
> rails console
> Loading development environment (Rails 4.0.0)
> 2.0.0-p643 :007 > old =
> Sequel.connect('postgres://USERNAME:PASSWORD@localhost/newscold',:search_path
> => "sitecontent,public")
> => #<Sequel::Postgres::Database:
> "postgres://USERNAME:PASSWORD@localhost/newscold"
> {:search_path=>"sitecontent,public"}
> > 2.0.0-p643 :008 > old.test_connection => true
> 2.0.0-p643 :003 > old.table_exists?(:tags)
> => false
> 2.0.0-p643 :004 > old.table_exists?(:items) => false
>
> Why is it not seeing the tables? I can connect to the DB and query it
> with postgresql.
>
> Any insight appreciated.
>
Could you put together a self-contained example showing the problem? My
best guess would be items and tags are not in the sitecontent or public
schemas, but that's basically a shot in the dark.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.