]> git.uio.no Git - usit-rt.git/blobdiff - sbin/rt-fulltext-indexer
Upgrade to 4.0.13
[usit-rt.git] / sbin / rt-fulltext-indexer
index bfb28cb1691be1dc2ce560d715d8245062858805..85b49c3a3059f0347972508b2abd8fea3509d974 100755 (executable)
@@ -374,9 +374,9 @@ sub process_pg {
 
     my $status = eval { $dbh->do( $query, undef, $$text, $attachment->id ) };
     unless ( $status ) {
-        if ($dbh->errstr =~ /string is too long for tsvector/) {
+        if ( $dbh->err == 7  && $dbh->state eq '54000' ) {
             warn "Attachment @{[$attachment->id]} cannot be indexed, as it contains too many unique words";
-        } elsif ($dbh->errstr =~ /invalid byte sequence/) {
+        } elsif ( $dbh->err == 7 && $dbh->state eq '22021' ) {
             warn "Attachment @{[$attachment->id]} cannot be indexed, as it contains invalid UTF8 bytes";
         } else {
             die "error: ". $dbh->errstr;