[Spacewalk-list] Problems with db import from oracle to postgres
Jan Pazdziora
jpazdziora at redhat.com
Tue Jul 12 14:09:51 UTC 2011
On Tue, Jul 12, 2011 at 02:01:19PM +0000, Silvio.Schanz at elektrobit.com wrote:
> Hi,
>
> fgrep -B1 rhnpackagerepodata spacewalk-oracle.dmp
> ...
> -- Types for rhnpackagerepodata: DOUBLE PRECISION BLOB BLOB BLOB DATE DATE
Can you apply the following patch to your spacewalk-dump-schema
and dump and import the schema again, to see if it addresses the
problem for you?
diff --git a/utils/spacewalk-dump-schema b/utils/spacewalk-dump-schema
index e391111..0068ed4 100755
--- a/utils/spacewalk-dump-schema
+++ b/utils/spacewalk-dump-schema
@@ -115,7 +115,7 @@ sub process_table {
if (ref $row->[$i] and ref $row->[$i] eq 'ARRAY') { # user types
no warnings 'uninitialized';
$row->[$i] = "(@{[ join ',', @{$row->[$i]} ]})";
- } elsif ($types[$i] eq 'unknown') { # blobs
+ } elsif ($types[$i] eq 'unknown' or $types[$i] eq 'BLOB') { # blobs
$row->[$i] =~ s!(.)! sprintf "\\\\%03o", ord($1) !seg;
} else {
$row->[$i] =~ s!([\x00-\x1f\x5c])! sprintf "\\x%02x", ord($1) !seg;
--
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat
More information about the Spacewalk-list
mailing list