Re: What Would You Like To Do?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Michael Nolan <htfoot(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: What Would You Like To Do?
Date: 2011-09-24 14:14:00
Message-ID: 4E7DE5A8.9080007@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/24/2011 09:51 AM, Bruce Momjian wrote:
> Joshua D. Drake wrote:
>> On 09/13/2011 11:51 AM, Michael Nolan wrote:
>>
>>> The ability to restore a table from a backup file to a different
>>> table
>>> name in the same database and schema.
>>>
>>>
>>> This can be done but agreed it is not intuitive.
>>>
>>>
>>> Can you elaborate on tha a bit, please? The only way I've been able to
>>> do it is to edit the dump file to change the table name. That's not
>>> very practical with a several gigabyte dump file, even less so with one
>>> that is much larger. If this capability already exists, is it documented?
>> You use the -Fc method, extract the TOC and edit just the TOC (so you
>> don't have to edit a multi-gig file)
> How does that work in practice? You dump the TOC, edit it, restore the
> TOC schema definition, then how do you restore the data to the renamed
> table?
>

How do you extract the TOC at all? There are no tools for manipulating
the TOC that I know of, and I'm not sure we should provide any. It's not
documented, it's a purely internal artefact. The closest thing we have
to being able to manipulate it is --list/--use-list, and those are
useless for this purpose. So this method description does not compute
for me either.

+1 for providing a way to restore an object to a different object name.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-09-24 14:43:52 Re: fix for pg_upgrade
Previous Message Bruce Momjian 2011-09-24 13:51:38 Re: What Would You Like To Do?