Hello Bill,

while updating 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.

Although the documentation states Postgres 7.3/7.4 or higher as 
prerequisite, consider updating to a new (8.4 or higher) version of 
postgres, as the support for even 8.2 will end in December 2010, see
http://jira.dspace.org/jira/browse/DS-618

Hope that helps

Claudia Jürgen


Am 03.08.2010 18:09, schrieb Bill Jordan:
>
> When I try to delete a collection in the 1.6.2 XMLUI interface, I get a
> referential integrity violation.  Here's the stack trace:
>
> Caused by: org.postgresql.util.PSQLException: ERROR:<unnamed>
> referential integrity violation - key in collection still referenced from
> community2collection
>           at
> org.postgresql.core.v2.QueryExecutorImpl.receiveErrorMessage(QueryExecutorImpl.java:557)
>           at
> org.postgresql.core.v2.QueryExecutorImpl.processResults(QueryExecutorImpl.java:480)
>           at
> org.postgresql.core.v2.QueryExecutorImpl.execute(QueryExecutorImpl.java:364)
>           at
> org.postgresql.core.v2.QueryExecutorImpl.execute(QueryExecutorImpl.java:258)
>           at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
>           at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
>           at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308)
>           at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
>           at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
>           at
> org.dspace.storage.rdbms.DatabaseManager.updateQuery(DatabaseManager.java:460)
>           at
> org.dspace.storage.rdbms.DatabaseManager.deleteByValue(DatabaseManager.java:605)
>           at
> org.dspace.storage.rdbms.DatabaseManager.delete(DatabaseManager.java:572)
>           at
> org.dspace.storage.rdbms.DatabaseManager.delete(DatabaseManager.java:807)
>           at org.dspace.content.Collection.delete(Collection.java:1137)
>           at
> org.dspace.content.Community.removeCollection(Community.java:917)
>           at
> org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils.processDeleteCollection(FlowContainerUtils.java:668)
>           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>           at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>           at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>           at java.lang.reflect.Method.invoke(Method.java:585)
>           at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
>           ... 219 more
>
> We ran the 1.5 to 1.6 schema update, and I see only the one
> comm2coll_collection_fk foreign key constraint.  We're still on postgres
> 7.3, but that supports deferred constraints.
>
> Has anyone else run into this issue?
>
> --Bill
>
> ****************************************************************
> William Jordan
> Associate Dean
> University of Washington Libraries
> Resource Acquisition and Description/
> Information Technology Services
> Box 352900, Seattle, WA 98195-2900
> Voice: (206) 685-1625   Fax: (206) 543-5457
> ****************************************************************
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> DSpace-tech mailing list
> DSpace-tech@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

-- 
Mit freundlichen Gruessen

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

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to