[Spacewalk-list] Please help with Oracle -> PostgreSQL migration

James Fillman jfillman at central1.com
Mon Dec 5 23:09:07 UTC 2011


The postgreSQL import stage of the migration is failing on me.



It bombs out with this error message:



ERROR:  invalid byte sequence for encoding "UTF8": 0xeda080

HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

CONTEXT:  COPY rhnpackagechangelogdata, line 136452



I found a posting from July where someone had a similar problem. You had him apply a patch to the spacewalk-dump-schema script. I went to apply the same patch and found it to already be there.



Here's a snippit from that old post:



On Tue, Jul 12, 2011 at 02:01:19PM +0000, Silvio.Schanz at elektrobit.com<mailto: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<file:///\\\%2503o>", ord($1) !seg;

                                } else {

                                        $row->[$i] =~ s!([\x00-\x1f\x5c])! sprintf "\\x%02x<file:///\\x%2502x>", ord($1) !seg;





The patch apparently worked for the other guy. When I check the oracle dump, I find the same 'Types' line:



-- Types for rhnpackagerepodata: DOUBLE PRECISION BLOB BLOB BLOB DATE DATE copy rhnpackagerepodata(package_id,primary_xml,filelist,other,created,modified) from stdin;



Any idea's?



Since I have to scheduled downtime in advance, it's taking me a while to try out your suggestions and make any progress. I appreciated the quickness of your previous responses.



Cheers,

--james

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20111205/5435cd2b/attachment.htm>


More information about the Spacewalk-list mailing list