[OPEN-ILS-GENERAL] How can we delete Org Units with SQL for EG 2.0 beta3

Repke de Vries repke at xs4all.nl
Thu Dec 2 12:23:46 EST 2010


Jason, I managed Workstation Registration at the Consortium Level

but following your advice literally with psql in a straight out-of- 
the-box EG 2.0 beta3 Virtual Image (different approach to maintaining  
Org Structure than 1.6 and before), I have zero success.

Maybe take this offline?  My time-zone btw is six hours later or more  
than than yours.

This is what psql [1] throws back at me:
"..
evergreen=# BEGIN;
BEGIN
evergreen=# DELETE FROM actor.org_unit WHERE id > 1;
NOTICE:  Use of uninitialized value $self in pattern match (m//) at / 
usr/local/share/perl5/MARC/File/XML.pm line 432.

CONTEXT:  SQL statement "UPDATE ONLY "serial"."record_entry" SET  
"owning_lib" = NULL WHERE $1 OPERATOR(pg_catalog.=) "owning_lib""
ERROR:  error from Perl function "maintain_control_numbers": No  
_parse_* routine defined on this driver (If it is a filter, remember  
to set the Parent property. If you call the parse() method, make sure  
to set a Source. You may want to call parse_uri, parse_string or  
parse_file instead.) [XML::LibXML::SAX=HASH(0x9bed980)] at /usr/share/ 
perl5/XML/SAX/Base.pm line 2616.
CONTEXT:  SQL statement "UPDATE ONLY "serial"."record_entry" SET  
"owning_lib" = NULL WHERE $1 OPERATOR(pg_catalog.=) "owning_lib""
evergreen=# DELETE FROM actor.org_address WHERE id > 1;
ERROR:  current transaction is aborted, commands ignored until end of  
transaction block
evergreen=# COMMIT;
ROLLBACK
evergreen=#
.."

Repke de Vries, IISH

[1]
"..
[opensrf at localhost run]$ psql -U evergreen -h localhost evergreen
Password for user evergreen:
psql (8.4.5)
Type "help" for help.

evergreen=#
.."


Op 1-dec-2010, om 19:42 heeft Jason Stephenson het volgende geschreven:

> Repke,
>
> Try this:
>
> BEGIN;
> DELETE FROM actor.org_unit WHERE id > 1;
> DELETE FROM actor.org_address WHERE id > 1;
> COMMIT;
>
> The above gets rid of everything but the sample consortium.
>
> HtH,
> Jason
>
>
> Quoting Repke de Vries <repke at xs4all.nl>:
>
>> Hi all
>>
>> this is a repost of a previous thread [1] now focussing on the   
>> following:
>>
>> deleting Organisational Units is different in 2.0 from 1.6 and  
>> can  not be achieved through the Staff Client.
>>
>> The only information how to do it directly in the database with  
>> SQL  comes from 1.6 documentation [2] and does indeed not work for  
>> 2.0:  this is what I get back in psql:
>> "..
>> evergreen=# delete from actor.org_unit where shortname = 'BR4' ;
>> ERROR:  update or delete on table "org_unit" violates foreign key   
>> constraint "org_address_org_unit_fkey" on table "org_address"
>> DETAIL:  Key (id)=(7) is still referenced from table "org_address".
>> evergreen=#
>> .."
>>
>> Can someone tell me what I should do (this will also help 2.0 DIG   
>> documenting)?
>>
>> Either exclusively SQL or in some combination with the Staff  
>> Client  Administrator functionality?
>>
>> Thanks, Repke, IISH
>>
>> [1]
>> http://georgialibraries.markmail.org/search/?q=Unexpected+results  
>> +changing+Organisational+Units+through+Staff+Client+in+EG+2.0  
>> +alpha4#query:Unexpected%20results%20changing%20Organisational% 
>> 20Units %20through%20Staff%20Client%20in%20EG%202.0%20alpha4+page: 
>> 1 +mid:t3qerg3qbws34hat+state:results
>> [2]
>> http://www.open-ils.org/dokuwiki/doku.php?id=evergreen- 
>> admin:policies:ou
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20101202/39c23779/attachment.htm 


More information about the Open-ils-general mailing list