PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
203 stars 235 forks source link

load.bey no longer works to sync data #324

Closed robkooper closed 9 years ago

robkooper commented 9 years ago

Constraints on species table does not allow to remove rows first to get them to update. This should be replaced with a complex upsert, which will update rows coming from the remote site, insert missing rows, and delete rows that are gone. An example of this is described in http://stackoverflow.com/a/17267423

robkooper commented 9 years ago

@mdietze This should be fixed now and database sync should work again. PLEASE FIRST MAKE A COPY OF THE DATABSE JUST IN CASE!

mdietze commented 9 years ago

ERROR: update or delete on table "species" violates foreign key constraint "species_exists" on table "pfts_species" DETAIL: Key (id)=(39315) is still referenced from table "pfts_species". DEL 49985ERROR: duplicate key value violates unique constraint "species_pkey" DETAIL: Key (id)=(1) already exists. CONTEXT: COPY species, line 1 ADD 0

robkooper commented 9 years ago

Mike, did you pull the latest version of PEcAn? I made a fix to the load.bey.sh script.

mdietze commented 9 years ago

Forgot to do a pull but now I get the following error:

psql: FATAL: role "root" does not exist Database bety does not exist, please create it: (see https://github.com/PecanProject/pecan/wiki/Installing-PEcAn#installing-bety) sudo -u postgres createuser -d -l -P -R -S bety sudo -u postgres createdb -O bety bety

However, the database bety definitely exists

robkooper commented 9 years ago

Same as before, try but make sure the database is backed up. This will make sync work again at BU.

@dlebauer until I fix #325 I will not yet sync the database from BU with EBI.