From: | Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> |
---|---|
To: | Matthew Byrne <matt(at)byrney(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Accidentally truncated pg_type |
Date: | 2011-07-12 01:24:55 |
Message-ID: | 4E1BA267.5040905@postnewspapers.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 12/07/11 08:12, Matthew Byrne wrote:
> I have a large database full of irreplaceable data, and due to a
> ridiculous happenstance I accidentally executed this code (as a superuser,
> of course):
>
> DELETE FROM pg_catalog.pg_type;
>
> Now the database is *seriously* unhappy - every SQL command returns an
> error message. How do I get at my data?
Do not attempt any recovery yet. STOP doing whatever you are doing. If
any programs are accessing the database, stop them.
Make a file-system level copy of your database ***NOW***. Put one
duplicate on a CD, external hard disk or other media you can completely
remove from your computer and put it somewhere safe. Keep the duplicate
copy on your hard drive to attempt recovery with.
Personally I'd make a copy, stop the postmaster, and make a second copy.
That's just because I don't know which would work out better. Up to you.
I don't suppose you have any backups of any older versions of the
database? If they are, are they PITR backups or are they pg_dump backups?
Have you already attempted any recovery steps? Document them in detail
if you have.
If this database is in any way important to you, you should consider
hiring an experienced professional to assist you with recovery. See:
http://www.postgresql.org/support/professional_support
--
Craig Ringer
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2011-07-12 01:25:52 | Re: Accidentally truncated pg_type |
Previous Message | Adrian Parker | 2011-07-12 01:23:27 | Alter Columns with Triggers |