Thank you. I have not run the command yet, and have been testing, but have not 
tested deleting items, collections, or communities, so I have not had the error 
you mentioned.  I suppose that after I run this command I will need to run 
index-init again.  I know it can't hurt, but is it necessary?

Thank you for this very clear explanation.

-Jose

-----Original Message-----
From: Claudia Jürgen [mailto:claudia.juer...@ub.tu-dortmund.de] 
Sent: Thursday, April 22, 2010 2:19 AM
To: dspace-tech@lists.sourceforge.net; Blanco, Jose
Subject: Re: [Dspace-tech] running the 15 to 16 script

Hello Jose,

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 following notes:

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

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


If you run into that error you got to inspect your db and use the 
references for the foreign keys:
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)

so the command would be:

ALTER TABLE community2collection DROP CONSTRAINT "$2";

A Note will be added to the upgrade step in the DSpace documentation.

Hope that helps

Claudia Jürgen



Am 19.04.2010 23:00, schrieb Blanco, Jose:
> I get the following erro:
>
> psql:database_schema_15-16.sql:105: ERROR:  constraint 
> "community2collection_collection_id_fkey" does not exist
>
> This is what I see when I look at the table.  I think I want to drop $2, but 
> how do I do that?
>
> Thank you!
> Jose
>
> dspace-dev-16=>  \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)
>      "comm2coll_collection_fk" FOREIGN KEY (collection_id) REFERENCES 
> collection(collection_id) DEFERRABLE
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> DSpace-tech mailing list
> DSpace-tech@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to