Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B2A1A64FD21 for ; Sun, 3 Aug 2008 22:59:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 47425-06 for ; Sun, 3 Aug 2008 22:59:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.241]) by postgresql.org (Postfix) with ESMTP id 7036A64FCE0 for ; Sun, 3 Aug 2008 22:59:29 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id d30so327061and.33 for ; Sun, 03 Aug 2008 18:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=MYgcnE6EyRSUZCCbFMCnxcLtSGEERXA1ie6diw28GFU=; b=LKJx/05SauDTmr1bSG5A+FhqB26ZO5Zw59t7mOwbJEgjBm/U0YAfHUiud6idZzl5Fq SqBM/jgdOFLsM7zWvHpOkpaNXLJ9TxQJQu6iM5pIcL5r/fKI44qiemMAWbXKiMnrV7Qp C7ryN5RFYbKCLZpv/On5bAB8hTnFrPNylTYWs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=xGAWL3msLex1IGkZbypnpuAAihDnAx0NfM49W8tWqMSLViHUpYS2F3VLxiYPm+TA4C DOIhdxsmxwDQPxRVtj/m+DDvPjR4HnAPUFppP8gfWHpu3fJXqEuch2EIyVHorRK3yx+s Jyry/NeDsVWPR0VSR/qHUJesS/6nPv4MSwEwM= Received: by 10.100.10.11 with SMTP id 11mr18961264anj.94.1217815167969; Sun, 03 Aug 2008 18:59:27 -0700 (PDT) Received: by 10.100.242.10 with HTTP; Sun, 3 Aug 2008 18:59:27 -0700 (PDT) Message-ID: Date: Sun, 3 Aug 2008 20:59:27 -0500 From: "Andrew Goodnough" To: pgsql-admin@postgresql.org Subject: client_encoding error on load MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_32842_9995626.1217815167965" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200808/9 X-Sequence-Number: 29854 ------=_Part_32842_9995626.1217815167965 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm using these commands to perform a dump and load. pg_dump -c lakevie_typo | gzip > $HOME/backups/typo_$DATE.sql.gz gzip < $HOME/backups/typo_$DATE.sql.gz |psql -d lakevie_typobak -f - The dump is fine but the load only works if I first extract the sql, then run it. Running it using the pipe to psql, I get: psql::71: ERROR: invalid byte sequence for encoding "UTF8": 0x8b 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". yet, doing a 'psql -l' shows this database to be UTF-8. And the dump file says: SET client_encoding = 'UTF8'; My goal is to get the two line dump/load working so I don't have any manual steps and sql files laying around. Any ideas? Andy ------=_Part_32842_9995626.1217815167965 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
I'm using these commands to perform a dump and load.

pg_dump -c lakevie_typo | gzip > $HOME/backups/typo_$DATE.sql.gz
gzip < $HOME/backups/typo_$DATE.sql.gz |psql -d lakevie_typobak -f -

The dump is fine but the load only works if I first extract the sql, then run it.  Running it using the pipe to psql, I get:

psql:<stdin>:71: ERROR:  invalid byte sequence for encoding "UTF8": 0x8b
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".

yet, doing a 'psql -l' shows this database to be UTF-8.  And the dump file says:

SET client_encoding = 'UTF8';


My goal is to get the two line dump/load working so I don't have any manual steps and sql files laying around.  Any ideas?

Andy
------=_Part_32842_9995626.1217815167965--