Hello Bernard,

  while running the db update script from 1.5 to 1.6 did you get some 
errors like that:

  psql:database_schema_15-16.sql:105: ERROR:  constraint
  "community2collection_collection_id_fkey" of relation
  "community2collection" does not exist ALTER TABLE

  psql:database_schema_15-16.sql:108: ERROR:  constraint
  "community2community_child_comm_id_fkey" of relation
  "community2community" does not exist ALTER TABLE

  psql:database_schema_15-16.sql:111: ERROR:  constraint
  "collection2item_item_id_fkey" of relation "collection2item" does not
  exist



  If so, inspect your database and use the references for the foreign
  keys to delete them, e.g::

  psql [YourDBName]
  \d [TableName]
  will show you the foreign keys, e.g.:
  \d community2collection

  Table "public.community2collection"

         Column     |  Type   | Modifiers

  ---------------+---------+-----------

  id            | integer | not null

  community_id  | integer |

  collection_id | integer |

  Indexes:

         "community2collection_pkey" PRIMARY KEY, btree (id)

         "community2collection_collection_id_idx" btree (collection_id)

         "community2collection_community_id_idx" btree (community_id)
  Foreign-key constraints:

         "$1" FOREIGN KEY (community_id) REFERENCES
  community(community_id)

         "$2" FOREIGN KEY (collection_id) REFERENCES
  collection(collection_id)



  In that case you got to run:


  ALTER TABLE collection2item DROP CONSTRAINT "$2";
  ALTER TABLE community2community DROP CONSTRAINT "$2";
  ALTER TABLE community2collection DROP CONSTRAINT "$2";

  The reason for this is:

  In Step 7 Update the database it can happen that not all the commands
  in the database_schema_15-16.sql are executed properly.

  The commands to drop foreign keys:

  ALTER TABLE collection2item DROP CONSTRAINT
  collection2item_item_id_fkey;

  ALTER TABLE community2community DROP CONSTRAINT
  community2community_child_comm_id_fkey;

  ALTER TABLE community2collection DROP CONSTRAINT
  community2collection_collection_id_fkey;

  assume that the keys got default names, whereas depending on the
  database version and operating system on which your instance started,
  they can have no names and just be counted internally.

  If you got no names or other names the script will skip the commands,
  with the above mentioned ERROR.

  This will lead to errors running DSpace as now 2 contraints exist and
  one is unable to delete items, collections etc.

  Hope that helps

  Claudia Jürgen

Am 13.03.2012 10:02, schrieb TORREILLES, Bernard:
> Hello all DSpace users,
>
> Can anybody help me?
>
> (Since the migration from 1.5.2 Manakin/XMLUI to 1.7.0 Manakin/XMLUI)
>
> when I delete item (after having delete all attached files, may be not 
> necessary) I get following messages (read more in attached file) :
> org.postgresql.util.PSQLException: ERROR: UPDATE or DELETE in the "item" 
> table violate the foreign key constraint
> <  $2>  of the table<  collection2item>
> Detail : the key (item_id)=(28467) is always referenced from the table<  
> collection2item>.
>
> when I delete the collection of the item
> org.postgresql.util.PSQLException: ERREUR: UPDATE or DELETE in the "item" 
> table violate the foreign key constraint
> <  $2>  of the table<  collection2item>
> Detail : the key (item_id)=(28467) is always referenced from the table<  
> collection2item>.
>
> when I delete the community of the collection
> org.postgresql.util.PSQLException: ERREUR: UPDATE or DELETE in the "item" 
> table violate the foreign key constraint
> <  $2>  of the table<  community2collection>
> Detail : the key (collection_id)=(2868) is always referenced from the table<  
> community2collection>.
>
> Thanks for any smart help
>
> Bernard Torreilles
> INIST-CNRS
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
>
>
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

-- 
Claudia Juergen
Universitaetsbibliothek Dortmund
Eldorado
0231/755-4043
https://eldorado.tu-dortmund.de/

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to