Re: Is thre a way?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is thre a way?
Date: 2009-05-07 12:14:42
Message-ID: gtujbi$dj$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-05-06, Anderson dos Santos Donda <andersondonda(at)gmail(dot)com> wrote:
> --0021cc022382dbd1bb0469443c6e
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
>
> Hi o/
>
> I have a table with 2000 names and emails.. and I did UPDATE list SET email
>= '' without the WHERE and now all rows is null in column email..
>
>
> I have a backup made with pg_dump.. is there a way to restore only the email
> data?

what format of pg_dump?

If a binary dump use pg_restore to restore the table you want to a
scratch database then use dblink or copy to get that into a temp table
in the database you want.

If a text dump use sed (or an interactive editor) to extract the table
data you want, load it into a temp table

finally do an
UPDATE ... FROM ....
to fix the losses.

I had to do this a few months ago.

In response to

  • Is thre a way? at 2009-05-06 20:28:26 from Anderson dos Santos Donda

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2009-05-07 12:15:14 Re: Upgrading from postgres 8.1 to 8.3
Previous Message Raymond O'Donnell 2009-05-07 12:12:50 Re: date ranges in where