X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 981D88B9E89 for ; Thu, 3 Feb 2005 17:38:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 58288-01 for ; Thu, 3 Feb 2005 17:38:25 +0000 (GMT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 287E38B9CEB for ; Thu, 3 Feb 2005 17:38:24 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 4.42) id 1CwkuO-000FeC-Hd; Thu, 03 Feb 2005 17:36:49 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id B66C91765D; Thu, 3 Feb 2005 17:38:21 +0000 (GMT) Message-ID: <4202618C.6010408@archonet.com> Date: Thu, 03 Feb 2005 17:38:20 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: problem with backup and restore (probaly stupit newb thing) References: <000a01c50a0b$769e48d0$797ba8c0@jfradkin> In-Reply-To: <000a01c50a0b$769e48d0$797ba8c0@jfradkin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.068 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/69 X-Sequence-Number: 20180 Joel Fradkin wrote: > Can anyone help me out on this (I will need to backup and restore the data > base, but am not savy on the proper save and restore syntax). I used the > default ones in PGadmin as detailed below and it blew up on > pg_restore: restoring data for table "tblaction" > pg_restore: ERROR: invalid byte sequence for encoding "UNICODE": 0xe9 > CONTEXT: COPY tblaction, line 1799, column value: "Chargé" > pg_restore: [archiver (db)] error returned by PQendcopy > pg_restore: *** aborted because of error Looking at your output, that's not the only error. > Backup command= > D:\Program Files\pgAdmin III\pg_dump.exe -i -h 192.168.123.112 -p 5432 -U > postgres -F c -b -v -f "D:\backups\postgrescompressed.backup" wazagua > > Restorecommand= > D:\Program Files\pgAdmin III\pg_restore.exe -i -h 192.168.123.112 -p 5432 -U > postgres -d waztest -v "D:\backups\postgrescompressed.backup" > > Using > ServerVersion: 07.03.0200 PostgreSQL 7.4.6 on i386-redhat-linux-gnu, > compiled by GCC i386-redhat-linux-gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2 Good to see all the information needed - means we don't need to make any guesses. > Resulting error text = > D:\Program Files\pgAdmin III\pg_restore.exe -i -h 192.168.123.112 -p 5432 -U > postgres -d waztest -v "D:\backups\postgrescompressed.backup" > pg_restore: connecting to database for restore > pg_restore: creating DUMP TIMESTAMP DUMP TIMESTAMP > pg_restore: creating SCHEMA public > pg_restore: creating COMMENT SCHEMA public > pg_restore: creating FUNCTION plpgsql_call_handler() > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 9; 1255 16207920 FUNCTION > plpgsql_call_handler() postgres > pg_restore: [archiver (db)] could not execute query: ERROR: syntax error at > or near "OWNER" at character 46 > Command was: ALTER FUNCTION public.plpgsql_call_handler() OWNER TO > postgres; OK - let's start here. The syntax here is fine, I just tested it on an 8.0 database. Are you sure the DB you are restoring to is version 8? > pg_restore: creating PROCEDURAL LANGUAGE plpgsql > pg_restore: creating FUNCTION inserttabledata(character varying, character > varying) > pg_restore: [archiver (db)] Error from TOC entry 10; 1255 16227934 FUNCTION > inserttabledata(character varying, character varying) postgres > pg_restore: [archiver (db)] could not execute query: ERROR: syntax error at > or near "$" at character 94 > Command was: CREATE FUNCTION inserttabledata(character varying, > character varying) RETURNS boolean > AS $_$ This is odd too - another version 8 feature. I've skipped to the end here: > pg_restore: restoring data for table "tblaction" > pg_restore: ERROR: invalid byte sequence for encoding "UNICODE": 0xe9 > CONTEXT: COPY tblaction, line 1799, column value: "Chargé" Well, it's complaining that the data you're restoring isn't unicode (UTF-8). Was the database you dumped from set up to store UTF-8 or was it SQL-ASCII or ISOxxxx? I suppose it might be something to do with a linux<=>windows transfer, but the place to start is running "psql -l" on the server. -- Richard Huxton Archonet Ltd