[OPEN-ILS-DEV] Postgres 8.3, small patches, and questions.

Reuben Pasquini rdp0004 at auburn.edu
Fri Feb 29 10:27:16 EST 2008


Hello!

I'm working through get Evergreen-ILS-1.2.1.4/OpenSRF-0.9 up and
running
on an Ubuntu Gutsy box.
I made the mistake of installing postgres 8.3 without realizing that
OpenILS
depends on the tsearch2 extention that has been modified in a
non-backward
compatible way in postgres 8.3.
         http://www.postgresql.org/docs/8.3/static/tsearch2.html 
Has anyone looked into porting 
       
Evergreen-ILS-1.2.1.4/Open-ILS/src/sql/Pg/000.english.pg82.fts-config.sql
to postgres 8.3, or is that an open task ?

Another 8.3 related patch will be required to lib_setup.cgi -
8.3 doesn't like doing a 'LIKE' search against an integer column, so
    actor::org_unit->search_like( {parent_ou=>'%' ...
bombs out with an error:

actor::org_unit can't SELECT id, parent_ou, ou_type, mailing_address,
billing_address, ill_address, holds_address, shortname, name, email,
phone, opac_visible FROM actor.org_unit WHERE parent_ou LIKE ? ORDER BY
name : DBD::Pg::st execute failed: ERROR: operator does not exist:
integer ~~ unknown LINE 3: WHERE parent_ou LIKE $1 ORDER BY name ^ HINT:
No operator matches the given name and argument type(s). You might need
to add explicit type casts. [for Statement "SELECT id, parent_ou,
ou_type, mailing_address, billing_address, ill_address, holds_address,
shortname, name, email, phone, opac_visible FROM actor.org_unit WHERE
parent_ou LIKE ? ORDER BY name " with ParamValues: 1='%'] at
/usr/local/share/perl/5.8.8/DBIx/ContextualFetch.pm line 52. at
/openils/var/cgi-bin/lib-setup.cgi line 204

-------------

I threw this patch on to get things working - there's probably a
cleaner way to do it:

$ diff
/home/pasquini/Download/Evergreen-ILS-1.2.1.4/Open-ILS/src/cgi-bin/lib-setup.cgi
/openils/var/cgi-bin/lib-setup.cgi
14c14
< do '##CONFIG##/live-db-setup.pl';
---
> do '/openils//conf/live-db-setup.pl';
203c203,205
< for my $lib ( actor::org_unit->search_like( {parent_ou => '%'},
{order_by => 'name'} ) ) {
---
> eval {
> #for my $lib ( actor::org_unit->search_like( {parent_ou => '%'},
{order_by => 'name'} ) ) {
> foreach my $lib ( actor::org_unit->search_like( {name => "%"},
{order_by => 'name'} ) ) {
206a209
>         next unless ( $lib->parent_ou );
208a212,216
> };
> my $s_error = '';
> if ( $@ ) {
>     $s_error = "FRICKJACK! $@\n";
> }
217a226
> print $s_error;


-------------

Anyway, I got pretty far along in the setup before realizing the
tsearch2 problem.
Along the way I had a screwed up libdbi + libdbdpgsql build which
broke
oils_cstore.so, which prevented auotgen.sh from completing.
In the process of tracking down the oils_cstore problem I patched
several of the autogen.sh perl scripts to deal with error conditions
a little better.  I'm not sure if all these patches make sense - 
the patches mostly modify the code to work around undefined
variables, but it may be better to modify the code to fail
with an informative error message if the situation is that the
variable should always be defined.
Anyway - here are a few patches:



------------------------

S$ diff 
/home/pasquini/Download/Evergreen-ILS-1.2.1.4/Open-ILS/src/extras/org_tree_html_options.pl
/openils/bin/
28c28
<       return unless ($node->opac_visible =~ /^[y1t]+/i);
---
>       return unless ((defined $node) && ($node->opac_visible =~
/^[y1t]+/i));

-------------------
pasquini at elfland01:/openils/lib/perl5/OpenILS$ diff
/home/pasquini/Download/Evergreen-ILS-1.2.1.4/Open-ILS/src/perlmods/OpenILS/Event.pm
.
80,81c80,85
<               $descs->{$lang} = {} unless $descs->{$lang};
<               $descs->{$lang}->{$code} = $d->textContent;
---
>                 if ( defined $lang ) {
>                   $descs->{$lang} = {} unless $descs->{$lang};
>                     if ( defined $code ) {
>                       $descs->{$lang}->{$code} = $d->textContent;
>                     }
>                 }


-----------------------
pasquini at elfland01:/openils/lib/perl5/OpenILS$ diff
/home/pasquini/Download/Evergreen-ILS-1.2.1.4/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Application/.
1043c1043,1044
<       $tree = new_editor()->search_actor_org_unit( 
---
>       $tree = undef;
>         my $v_data = new_editor()->search_actor_org_unit( 
1052,1054c1053,1057
<       )->[0];
< 
<       $cache->put_cache('orgtree', $tree);
---
>       );
>       if ( ref $v_data ) {
>             $tree = $v_data->[0];
>           $cache->put_cache('orgtree', $tree);
>         }


-------------------------------

Anyway, please let me know if anyone has a Postgres 8.3 .sql file
I can use, otherwise I'll get to work on redoing my postgres install
with 8.2.
Let me know if there's some place else that I should be sending these
patches.

Thanks for the help!
Reuben



More information about the Open-ils-dev mailing list