I'm trying to use heroku db:pull to clone my production database to my
dev box for testing.  We're using foreign keys in our database (since
postgres has such excellent support for it, and I'm a believer in the
importance of referential integrity).  When I run db:pull, I get an
error:

/Users/myronmarston/.rvm/gems/ruby-1.8.7-p249/gems/sequel-3.0.0/lib/
sequel/adapters/postgres.rb:135:in `async_exec': PGError ERROR:
insert or update on table "geography_promotion_addresses" violates
foreign key constraint
"geography_promotion_addresses_geography_promotion_id_fk" 
(Sequel::DatabaseError)
DETAIL:  Key (geography_promotion_id)=(1) is not present in table
"geography_promotions".

I'm guessing this is because taps loads all of each table, before
proceeding to the next table, which causes FK constraint violations.

What is the recommended way for cloning a production DB to a dev box
when you're using foreign keys?

Thanks,
Myron

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to