[OPEN-ILS-DEV] Deleting the example branches

Mike Rylander mrylander at gmail.com
Mon Mar 31 10:50:51 EDT 2008


On Mon, Mar 31, 2008 at 9:53 AM, Robert Nix <glibrarysystem at gmail.com> wrote:
> Mike,
>
>   I keep getting the foreign key restraints error and I can't figure out
> which tables are linked to go deeper to delete the items from it. I have
> found that the items are linked to the tables actor.org_unit_type and
> transit_copy. In the actor.org_unit_type I can't delete the relations there
> either because of the same error and I can't even get the transit_copy table
> to display any information to see what relations are there. I keep getting
> the error: relation "transit_copy" does not exist. I know it's there because
> of the error I get when trying to delete the parent_ou for the example
> libraries. It says DETAIL: Key (id)=(12) is still referenced from table
> "transit_copy". Any suggestions or table names I can start from would be
> greatly appreciated. I have very little DB knowledge as I have not worked
> with them very long. I have only worked with very rudementary things in DB's
> such as importing sql files and basic queries.

After you've got data (from transactions such as transits or
circulations) attached then the referential integrity checks keep you
from removing objects that are part of those transactions.

If you have the data required to reload your bibs (the output of
parallel_pg_loader, say) then my suggestion would be to recreate the
database from scratch, and trim down the list of actor.org_unit
objects to those you need after loading the data, but before beginning
your tests.

As a side not, all of this administration will become much simpler in
1.4, as I'm currently neck deep in admin interface code.

--miker

>
> Thanks again in advance,
> Robert
>
>
>
> On Tue, Mar 25, 2008 at 9:50 AM, Robert Nix <glibrarysystem at gmail.com>
> wrote:
>
> >
> > Mike,
> >
> >   I keep getting the foreign key restraints error and I can't figure out
> which tables are linked to go deeper to delete the items from it. I have
> found that the items are linked to the tables actor.org_unit_type and
> transit_copy. In the actor.org_unit_type I can't delete the relations there
> either because of the same error and I can't even get the transit_copy table
> to display any information to see what relations are there. I keep getting
> the error: relation "transit_copy" does not exist. I know it's there because
> of the error I get when trying to delete the parent_ou for the example
> libraries. It says DETAIL: Key (id)=(12) is still referenced from table
> "transit_copy". Any suggestions or table names I can start from would be
> greatly appreciated. I have very little DB knowledge as I have not worked
> with them very long. I have only worked with very rudementary things in DB's
> such as importing sql files and basic queries.
> >
> > Thanks again in advance,
> > Robert
> >
> >
> >
> >
> >
> > On Mon, Mar 24, 2008 at 9:50 AM, Robert Nix <glibrarysystem at gmail.com>
> wrote:
> >
> > >
> > > Mike,
> > >
> > >   Thanks for the suggestion but I'm not familiar enough with sql
> commands to dig to the deeper trees to find where these items are linked to
> delete them. Any suggestions are appreciated. In the mean time I'll be
> looking in some postgres material online to figure out how to get to those
> deeper elements to delete them. Also, I used the install script from John
> Schmidt so the database was created for me which is another reason that I'm
> not sure of the order of tables or the names of those tables in which I need
> to delete the items from first.
> > >
> > > Thanks in advance for all of the help,
> > > Robert
> > >
> > >
> > >
> > >
> > >
> > > On Fri, Mar 21, 2008 at 6:20 PM, Mike Rylander <mrylander at gmail.com>
> wrote:
> > >
> > > >
> > > > On Fri, Mar 21, 2008 at 4:14 PM, Robert Nix <glibrarysystem at gmail.com>
> wrote:
> > > > > Dan,
> > > > >
> > > > >   I tried to delete them from postgres but I get the error that it
> violates
> > > > > the foreign key constraint "org_unit_parent_ou_fkey" on "org_unit"
> and the
> > > > > detail on that is that the Key is sitll referenced from table
> "org_unit".
> > > > > Any thoughts on this error? I understand the concept of the foreign
> key as
> > > > > it is a primary key in another table but I don't know how to get
> around this
> > > > > error. I would assume it needs to be deleted in the org_unit first
> before
> > > > > deleting it from the actor.org_unit table. Is this a correct
> assumption?
> > > > >
> > > >
> > > > You'll just need to remove the subordinate org units first.  Delete
> > > > from the deepest part of the tree out.  This constraint is in there to
> > > > avoid accidental deletion of an object that's in use.
> > > >
> > > > Let us know if that does/doesn't help!
> > > >
> > > > --
> > > > Mike Rylander
> > > >  | VP, Research and Design
> > > >  | Equinox Software, Inc. / The Evergreen Experts
> > > >  | phone: 1-877-OPEN-ILS (673-6457)
> > > >  | email: miker at esilibrary.com
> > > >  | web: http://www.esilibrary.com
> > > >
> > >
> > >
> >
> >
>
>



-- 
Mike Rylander
 | VP, Research and Design
 | Equinox Software, Inc. / The Evergreen Experts
 | phone: 1-877-OPEN-ILS (673-6457)
 | email: miker at esilibrary.com
 | web: http://www.esilibrary.com


More information about the Open-ils-dev mailing list