Hi Claudia,

Perfect! I tried your suggestions & the problem is fixed. Many thanks
for your help.

Regards,
Harish

Harish Maringanti
Systems Analyst
K-State Libraries
785.532.3261

On Wed, Jan 19, 2011 at 12:57 PM, Claudia Juergen
<[email protected]> wrote:
> Hello Harish,
>
> 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.
>
>
> Hope that helps
>
> Claudia Jürgen
>
>
>> We are having trouble deleting items in 1.6.2. I looked through the
>> error log & this is what I found -
>>
>> -----------------------------
>> database_error:org.postgresql.util.PSQLException\colon; ERROR\colon;
>> update or delete on table "item" violates foreign key constraint "$2"
>> on table "collection2item"
>> -------------------------------------------
>>
>> I found a thread referring to the same problem -
>> http://sourceforge.net/mailarchive/message.php?msg_id=24951813 but did
>> not any answers. Can I just drop the constraints or is there another
>> way to resolve this ? Any help appreciated.
>>
>> Thanks,
>> Harish
>>
>> Harish Maringanti
>> Systems Analyst
>> K-State Libraries
>> 785.532.3261
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them. Understand
>> malware threats, the impact they can have on your business, and how you
>> can protect your company and customers by using code signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> DSpace-tech mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>
>
>
> Mit freundlichen Gruessen
>
> Claudia Juergen
> Universitaetsbibliothek Dortmund
> Eldorado
> 0231/755-4043
> https://eldorado.tu-dortmund.de/
> Tel.: 0049-231-755-4043
>
>
>
>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to