Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBsR2-0008JQ-Qc for pgsql-admin@arkaria.postgresql.org; Tue, 07 Nov 2017 01:12:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eBsR1-0004DZ-GM for pgsql-admin@arkaria.postgresql.org; Tue, 07 Nov 2017 01:12:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eBsPD-0000yD-JE for pgsql-admin@postgresql.org; Tue, 07 Nov 2017 01:10:19 +0000 Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eBsPB-0004k2-1p for pgsql-admin@postgresql.org; Tue, 07 Nov 2017 01:10:18 +0000 Received: by mail-io0-x233.google.com with SMTP id 134so422659ioo.0 for ; Mon, 06 Nov 2017 17:10:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=propaas-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=5JYs+BLt1lrUZ7WJoasQdLRpkIJOq+Pi/k+5DH22Gss=; b=ce7u01v8aXaKT4knWvyXil+V4cy0J8V/NJ5oQgKFh+cran3dVpBzWo3gIgauajD/ne Clmze+wJ4XIl+82Kp746DtJIBvz/8PxrfrfsgmQmolbtjMhQKQeJCZolrk7Hzs16iQLl 7cG+i+8VOQ7hPVaoU+ZRJcZkTjABELQXNuQNYlLVNpAGEZM+Z+Hg7E/8dNUSGdI4AmKk Elu8BtmeOOT5bND4ylOvHMiikca1UdyTfeez6+OE6NliTtCpTRS4j+VUJ7XIMXJlXCDg gUKCt8oJAIvu39MnVMytiwUNPX0I0tM3L9h9HuvsbIuuU7tsvOmGvNr/546Trr3CVpPt YWhw== 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=5JYs+BLt1lrUZ7WJoasQdLRpkIJOq+Pi/k+5DH22Gss=; b=pRd4ewKK7mbuLjm0QyqjkJopfMGEVGFGqMI/lvYWtMjZWMcMMGWshl5MjenwzNEVMi VuXWU7sZbgU3ZYEpB2EjrYKjqVF0j3XcCRIZuA1OOmxE1eBrPsxlcMsLVpEcgQh2QnSM Y7esQMRSgK0FCQhSmCIZtlaRikA5ERtk9sRaHH0AKsjLaLiGiufE4thcfimVWi6OZLNL 87CI7mSdCeUsgv3CR7nLLO/uXyxv0O7/EC494aWbEZAu+lMMw+jCstu/dsLLcmZArRGR cifFYxwbI74dFbt0saA7JV3B9mpic4DcKHjArTn7YE/Cs7VPIqGFLujmb8lm9Oez7don VGbQ== X-Gm-Message-State: AJaThX7kVfqLy8oO9l80jhn1rNNhaaX6SdrNMoxUQISEzmykS0GVq41E PdDt2kEmM6FLeax4WZyR67MevQzYl4g= X-Google-Smtp-Source: ABhQp+SpvbnYDSWj2lTIs7h6xDaDVENnN8znKs37QNlhfyoKdi5535fS7v4aSXgu6aYCilYGtWnKuQ== X-Received: by 10.107.44.78 with SMTP id s75mr21511359ios.110.1510017016009; Mon, 06 Nov 2017 17:10:16 -0800 (PST) Received: from [192.168.93.98] ([4.34.53.130]) by smtp.gmail.com with ESMTPSA id m126sm21087ioa.9.2017.11.06.17.10.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 17:10:15 -0800 (PST) To: pgsql-admin From: PropAAS DBA Subject: ERROR: invalid byte sequence for encoding "UTF8": 0x00 Message-ID: Date: Mon, 6 Nov 2017 18:10:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org All; we are doing an oracle to Postgresql conversion, lots and lots of the oracle columns throw this error: ERROR: invalid byte sequence for encoding "UTF8": 0x00 CONTEXT: converting column [colname] for foreign table scan of [tablename] row xxx We are using the ora_fdw oracle foreign data wrapper extension to perform the data conversion, we create the foreign tables via the "IMPORT FOREIGN SCHEMA" option, then do an insert in [postgres_table] select * from [ora_fdw_table] I've tried a number of fixes but they all seem to replace the data for ALL rows instead of just the broken ones. For example: select id, cname from ora_fdw_schema.cust_names ERROR: invalid byte sequence for encoding "UTF8": 0x00 CONTEXT: converting column cname for foreign table scan of ora_fdw_schema.cust_names, row 122 If I use replace then ALL rows are NULL: select id, replace(cname,'',NULL)  from ora_fdw_schema.cust_names     id    |         replace ---------+---------------------- 1         | 2         | 3         | 4         | 5         | 6         | 7         | Same thing if I use translate: select id, translate(cname,'',NULL)  from ora_fdw_schema.cust_names Help? Thanks in advance -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin