On Tue, Mar 26, 2013 at 12:40:46PM +0000, Smith, Ina <ism...@sun.ac.za> wrote:
> I want to delete a metadata filed from the Dublin Core Registry from our 
> repository. There is the option to delete a field. For some reason it isn't 
> working. I've also tested it on a clean installation. Any advice? The error I 
> get:
> 
> org.postgresql.util.PSQLException: ERROR: update or delete on table 
> "metadatafieldregistry" violates foreign key constraint 
> "metadatavalue_metadata_field_id_fkey" on table "metadatavalue"
> Detail: Key (metadata_field_id)=(5) is still referenced from table 
> "metadatavalue".
> 
> What kind of change do we need to make?

It appears that there are items which have values for that field.
DSpace (or rather, the DBMS at DSpace's direction) is correctly
preventing you removing the definition of a field which is still in
use.  You'd need to edit all of those items and remove the field
value(s).

If you're comfortable with operating directly on the database, you
could back it up and run a query to delete all rows from the
"metadatavalue" table which have the "id" of that field in the
"metadata_field_id" column.  Or you could write a curation task to
hunt down those items and remove the relevant field value(s).

-- 
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
There's an app for that:  your browser

Attachment: pgpGj8z8eS6CV.pgp
Description: PGP signature

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to