[Babase] preg upload creates error in cycstats

kfenn kfenn at princeton.edu
Mon Jan 28 13:53:01 EST 2008


Hi Karl,

Well nothing is ever easy, is it?  Step one in this update involves 
putting a pregnancy in to the system that was missed/leftover from the 
06b updata for reasons not worth explaining.  It uploaded with little 
fuss last time, but now I'm getting a new error message.

ERROR: update or delete on "cycpoints" violates foreign key constraint 
"Cpids on CYCPOINTS" on "cycstats" DETAIL: Key (cpid)=(30136) is still 
referenced from table "cycstats". CONTEXT: SQL statement "DELETE FROM 
cycpoints WHERE cpid = $1 " PL/pgSQL function "_remove_autom" line 56 at 
SQL statement SQL statement "SELECT _remove_autom( $1 , $2 , $3 )" 
PL/pgSQL function "cycpoints_func" line 130 at perform SQL statement 
"UPDATE cycpoints SET cpid = cpid WHERE cpid = $1 " PL/pgSQL function 
"pregs_func" line 165 at SQL statement

I think I understand it: an automatic mdate was already been created for 
the cycle following the conceptive date for this pregnancy.  Because of 
this mdate, there are also a series of records in the cycstats table.  I 
can't just make the cycle a conceptive cycles because the cycstats 
already say it wasn't.

I thought I could try a DELETE statement to get rid of the automatic 
mdate and then let the system regenerate the cycstats for this female, 
but the system is still complaining about that cycstat table.

ERROR:  update or delete on "cycpoints" violates foreign key constraint "Cpids on CYCPOINTS" on "cycstats"
DETAIL:  Key (cpid)=(30136) is still referenced from table "cycstats".

*In statement:*
Delete from cycpoints where cpid = 30136;

So I'm not sure what to do or why this error is just appearing now.  I 
have a vague recollection that we had not yet generated the new cycstats 
before in babase _test....so I went looking for info on how I might do 
that anyhow, but I couldn't find anything about the cycstasts table in 
the papio index.  Am I blind?  Is there documentation on that table?  
How do I fix these errors and do you think I'm likely to see them again 
as I load more pregs?  I don't really have a handle on how or when 
cycstats gets updated.

Help!

Tabby


-- 
Tabby Fenn
Research Assistant

Dept of Ecology and Evolutionary Biology
401 Guyot Hall
Princeton University
Princeton, NJ  08544

609 258-6898 (Ph)
609 258-2712 (Fx)



More information about the Babase mailing list