Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lazjx-0008BH-KR for pgsql-general@arkaria.postgresql.org; Mon, 26 Apr 2021 11:49:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lazjw-0000M6-GP for pgsql-general@arkaria.postgresql.org; Mon, 26 Apr 2021 11:49:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lazjw-0000Ly-6K for pgsql-general@lists.postgresql.org; Mon, 26 Apr 2021 11:49:24 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lazjt-0005PU-TB for pgsql-general@lists.postgresql.org; Mon, 26 Apr 2021 11:49:23 +0000 Received: by mail-ot1-x330.google.com with SMTP id e89-20020a9d01e20000b0290294134181aeso25987870ote.5 for ; Mon, 26 Apr 2021 04:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=eNthCPEdRu0KF3KMAjJJVYpt+/cJ8sQwvosC0C/YKrw=; b=Y0rEPdr2yFQYXtNI7jd9fBpKbu5LsMVxITy23gWQ3HU5V50y58UbmFG8kdSDp7bJlk 8C6aKcYR8nm+HZN6GFXrmdZZa7XN20S5AjZnqBMydkpU73GK4sTW2hVtN0dyQCeSx1TH W+7CvFo+T7gc0+L+bBZZ7xXdsc+ixh/U3i1QD9KpF7GERjg+PThyvMEgu+osE1/a34KA NjgDCTCflHQGs2ctcnk2MKGRyFVsUUE1Myd942EHFadY5BdWaOpQVjbhr6wH4pxqrmlO ch6w9Xd//HWBuO5HgRDVfHNdajdEpiqe8sdB08FD+ocNQyIOekcsiPPs4NC1l+4rsXvz 3dbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=eNthCPEdRu0KF3KMAjJJVYpt+/cJ8sQwvosC0C/YKrw=; b=dakNwKNS2c8abxqByGRIFI0OLuBEXWwjqO+NU/l7ZHYw1bdVSPwNh25hY0JXA0UCbM FvKuU1OT4ajFfkqYhz5HZu+NEKX3r7UkcMMWacyOaIqWaL9OU0xdSsdtVQaumIlFqMkl p8S9Z0P72W6DKNH2MhY80ilYh3H+6np1AFxmZJV2dzxWRQohFiOW6jKsWr5FUCxzFUwI bjrRVWhB83WbYMN+4Dw9x27d48tIYLjeyFdo1nzUliv/9i4DaOJUsRQMrsuOLk2VJFUu Mo53l+uWQUUtXYkD1oNP328nXJaIgQGzC9OqeMawS+ibesfudHx2hOyEIFh7nIatLOYC nTrQ== X-Gm-Message-State: AOAM5320pj29NHkO8s8NN0HqQe7/rnGEmCxQUV4k34/IEWSsQs2hTjmJ 8OPXWCHKiwT7QQuCmtW5ydjAkGjancU= X-Google-Smtp-Source: ABdhPJx8Q4ztXaWmYaBIOJ2GmuNtzWGq3Wh9wqo0tyEUs0F6AF7WhnJTQtTK2PHBJqc6J6AwCP8Xaw== X-Received: by 2002:a05:6830:150d:: with SMTP id k13mr14401168otp.156.1619437759725; Mon, 26 Apr 2021 04:49:19 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id h22sm814223otj.33.2021.04.26.04.49.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Apr 2021 04:49:19 -0700 (PDT) To: pgsql-general@lists.postgresql.org From: Ron Subject: Invalid byte sequence when importing Oracle BLOB Message-ID: Date: Mon, 26 Apr 2021 06:49:18 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, The source is an Oracle 12 db with this encoding: NLS_LANG = AMERICAN_AMERICA.AL32UTF8 NLS_NCHAR = AL32UTF8 The destination is an (RDS) Postgresql 12.5 with encoding UTF8, and is being loaded through COPY commands generated by ora2pg. The source table has a BLOB column (I think they are scanned images) which I'm loading into a Postgresql bytea column. Seven times out of about 60M rows, I get this error: Psql:909242: ERROR:  invalid byte sequence for encoding "UTF8": 0xed 0xaf 0xbf Is there anything I can change on the Postgresql side to make these records import correctly? -- Angular momentum makes the world go 'round.