On Tue, Mar 26, 2013 at 12:40:46PM +0000, Smith, Ina <ismith@...> 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
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 mwood@...
There's an app for that: your browser