From kraj@illumen.com Fri Aug 4 17:07:08 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 550949FB2F9 for ; Fri, 4 Aug 2006 14:07:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 96944-03 for ; Fri, 4 Aug 2006 14:06:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stash.illumen.com (unknown [64.207.29.137]) by postgresql.org (Postfix) with ESMTP id 019CD9FB282 for ; Fri, 4 Aug 2006 14:06:58 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6B7E8.64949EC2" Subject: Restoring dtabase problem X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 4 Aug 2006 11:06:57 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Restoring dtabase problem Thread-Index: Aca36GSCeDn1rcDtTx6rUmjh7fx5lA== From: "Benjamin Krajmalnik" To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/44 X-Sequence-Number: 22588 This is a multi-part message in MIME format. ------_=_NextPart_001_01C6B7E8.64949EC2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am trying to restore a database from a pg_dump. I have a problematic issue in that a few rows have a problem with UTF-8 encoding. All of these rows are in a specific table. Is there something I can run against the table which will validate the rows which have the bad data and delete the rows? =20 The database is quite large (8GB) and I was informed that it would be much faster to restore using the COPY method as opposed to the INSERT method. Any and all assistance will be deeply appreciated. =20 Regards, =20 Benjamin ------_=_NextPart_001_01C6B7E8.64949EC2 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I am = trying to=20 restore a database from a pg_dump.
I have = a problematic=20 issue in that a few rows have a problem with UTF-8 = encoding.
All of = these rows=20 are in a specific table.
Is = there something I=20 can run against the table which will validate the rows which have the = bad data=20 and delete the rows?
 
The = database is=20 quite large (8GB) and I was informed that it would be much faster to = restore=20 using the COPY method as opposed to the INSERT = method.
Any = and all=20 assistance will be deeply appreciated.
 

Regards,
 
Benjamin
------_=_NextPart_001_01C6B7E8.64949EC2-- From rossacher@bluewin.ch Fri Aug 4 19:36:33 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5F3059FB248 for ; Fri, 4 Aug 2006 16:36:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 30714-10 for ; Fri, 4 Aug 2006 16:36:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail17.bluewin.ch (mail17.bluewin.ch [195.186.18.64]) by postgresql.org (Postfix) with ESMTP id 06AA99FB1D2 for ; Fri, 4 Aug 2006 16:36:28 -0300 (ADT) Received: from [192.168.1.74] (83.79.155.91) by mail17.bluewin.ch (Bluewin 7.3.110.2) id 44B3612F0051F5D1 for pgsql-admin@postgresql.org; Fri, 4 Aug 2006 19:36:27 +0000 From: Ivo Rossacher To: pgsql-admin@postgresql.org Subject: Re: Restoring dtabase problem Date: Fri, 4 Aug 2006 21:36:11 +0200 User-Agent: KMail/1.8.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608042136.11676.rossacher@bluewin.ch> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/47 X-Sequence-Number: 22591 Am Freitag, 4. August 2006 19.06 schrieb Benjamin Krajmalnik: > I am trying to restore a database from a pg_dump. > I have a problematic issue in that a few rows have a problem with UTF-8 > encoding. > All of these rows are in a specific table. > Is there something I can run against the table which will validate the > rows which have the bad data and delete the rows? Typically this issue is related to a low number of invalid characters comming up a lot of time in the file. So I would replace the invalid codes with the correct unicode character by a text editor (take care to choose the correct encoding in the editor). In the context of the rest of the text it becomes mostly clear what the correct unicode character should be. > > The database is quite large (8GB) and I was informed that it would be > much faster to restore using the COPY method as opposed to the INSERT > method. This is correct, but has to be done when dumping (see man pg_dump -> options -d -D). 8GB, well this will take quite some time with inserts ... Regards Ivo > Any and all assistance will be deeply appreciated. > > > Regards, > > Benjamin From kraj@illumen.com Fri Aug 4 19:49:06 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9230C9FB248 for ; Fri, 4 Aug 2006 16:49:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 41294-09 for ; Fri, 4 Aug 2006 16:48:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stash.illumen.com (unknown [64.207.29.137]) by postgresql.org (Postfix) with ESMTP id 9949D9FB1D2 for ; Fri, 4 Aug 2006 16:48:55 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: Restoring dtabase problem X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 4 Aug 2006 13:48:54 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] Restoring dtabase problem Thread-Index: Aca3/WZHrDRYwrubQ5K8GCbWyKmGXQAAB4/A From: "Benjamin Krajmalnik" To: "Ivo Rossacher" , X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.041 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/48 X-Sequence-Number: 22592 The problem is that I do not which rows have the problem. Out of a few thousand rows, there are only about 15 rows with the problem. I was wondering if there is some validation which I can run as a script against the table so it wil delete it. How much faster is the copy method as opposed to the insert? The only other idea which I had was to do a pg_dump of the schema, and then individual pg_dumps for each table. That way, I can use the copy method for all of the tables other than the particular table. I looked for an option to exclude a table from the dump, but did not find such an option. I am going to try a long shot right now since I am going from Windows to FreeBSD. I stopped Postgres on the Windows machine and tar'ed the data directory. Now I am going to move it to the FreeBSD box and see what happens. Probably won't work, but what the heck! As an alternative oprion, I may do a table dump of the table with the problems in insert mode, turn on logging, and see if I can identify the culprit rows that way and then delete them. =20 > -----Original Message----- > From: pgsql-admin-owner@postgresql.org=20 > [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Ivo Rossacher > Sent: Friday, August 04, 2006 1:36 PM > To: pgsql-admin@postgresql.org > Subject: Re: [ADMIN] Restoring dtabase problem >=20 > Am Freitag, 4. August 2006 19.06 schrieb Benjamin Krajmalnik: > > I am trying to restore a database from a pg_dump. > > I have a problematic issue in that a few rows have a problem with=20 > > UTF-8 encoding. > > All of these rows are in a specific table. > > Is there something I can run against the table which will=20 > validate the=20 > > rows which have the bad data and delete the rows? >=20 > Typically this issue is related to a low number of invalid=20 > characters comming up a lot of time in the file. So I would=20 > replace the invalid codes with the correct unicode character=20 > by a text editor (take care to choose the correct encoding in=20 > the editor). In the context of the rest of the text it=20 > becomes mostly clear what the correct unicode character should be. >=20 > > > > The database is quite large (8GB) and I was informed that=20 > it would be=20 > > much faster to restore using the COPY method as opposed to=20 > the INSERT=20 > > method. >=20 > This is correct, but has to be done when dumping (see man=20 > pg_dump -> options -d -D). 8GB, well this will take quite=20 > some time with inserts ... >=20 > Regards > Ivo >=20 > > Any and all assistance will be deeply appreciated. > > > > > > Regards, > > > > Benjamin >=20 > ---------------------------(end of=20 > broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org=20 > so that your > message can get through to the mailing list cleanly >=20 From jd@commandprompt.com Fri Aug 4 20:25:12 2006 X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id A73CC9FB30F for ; Fri, 4 Aug 2006 17:25:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 79982-09 for ; Fri, 4 Aug 2006 20:25:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 924B59FB301 for ; Fri, 4 Aug 2006 17:25:03 -0300 (ADT) Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k74KOmJi017885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Aug 2006 13:24:49 -0700 Message-ID: <44D3AD0D.1040200@commandprompt.com> Date: Fri, 04 Aug 2006 13:24:45 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.5 (X11/20060728) MIME-Version: 1.0 To: Benjamin Krajmalnik CC: Ivo Rossacher , pgsql-admin@postgresql.org Subject: Re: Restoring dtabase problem References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.3, clamav-milter version 0.88.3 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Fri, 04 Aug 2006 13:24:50 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/50 X-Sequence-Number: 22594 Benjamin Krajmalnik wrote: > The problem is that I do not which rows have the problem. > Out of a few thousand rows, there are only about 15 rows with the > problem. > I was wondering if there is some validation which I can run as a script > against the table so it wil delete it. > > How much faster is the copy method as opposed to the insert? Exponential. Joshua D. Drake -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/