[OPEN-ILS-GENERAL] Clean up holdings

Geoff Sinclair geoffs at eclibrary.ca
Tue Sep 29 17:20:18 EDT 2009


Hi Geoff,

The problem is that you didn't clean out the staging_items table before 
you did the second import.
Make sure to do this before you do the second and subsequent imports 
(even if you've cleaned out the database-- it doesn't clean out the 
staging table):
    psql -U postgres evergreen
    # DROP TABLE staging_items;

Also, when you get to the last step of the import_demo the second time 
around, you can expect to see another error.  E.g.,
    root:~/import_demo# psql -U evergreen -h localhost -f 
generate_copies.sql evergreen
    BEGIN
    psql:generate_copies.sql:7: ERROR:  duplicate key violates unique 
constraint "acl_name_once_per_lib"
    psql:generate_copies.sql:18: ERROR:  current transaction is aborted, 
commands ignored until end of transaction block
    psql:generate_copies.sql:25: ERROR:  current transaction is aborted, 
commands ignored until end of transaction block
    psql:generate_copies.sql:61: ERROR:  current transaction is aborted, 
commands ignored until end of transaction block
    ROLLBACK

I think these errors appear because the first SQL statement in the 
"generate_copies.sql" file is trying to create shelving locations that 
already exist.

This last part will be a problem if you introduce new shelving locations 
within the second batch.  If all the shelving locations in the second 
batch were already present in the first batch, I think you can safely 
comment out the first SQL statement in the file. Otherwise, if there are 
locations in the second batch file that aren't in the first, copies will 
not be created for those locations.

Anyone know a better way to deal with this?

Thanks,
Geoff

Geoff Sinclair wrote:
> Hi,
>
> I'm running 1.4.0.4.  I'm testing the bibliographic record import 
> process, and I've just (successfully) followed the instructions for  
> the import_demo located here:
> http://svn.open-ils.org/trac/ILS-Contrib/browser/import_demo/trunk
>
> I followed this up with the process "Restoring your Evergreen database 
> to an empty state" that's outlined here:
> http://open-ils.org/dokuwiki/doku.php?id=evergreen-admin:importing:bibrecords 
>
>
> The second import contained the same set of bibliographic records, but 
> with different holdings in 999.
>
> When I do the import the second time, the holdings for the first 
> import show up in the OPAC.  Is there a way to remove holdings as well 
> when I restore my Evergreen database to an empty state?
>
> Thanks,
> Geoff
>



More information about the Open-ils-general mailing list