Re: Help with restoring a dump in Tar format? (dependencies/ordering)

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>, David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help with restoring a dump in Tar format? (dependencies/ordering)
Date: 2017-06-06 00:52:13
Message-ID: 6958c890-b764-f91d-5e59-8c20213baefa@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/05/2017 05:15 PM, Ken Tanzer wrote:
> Thanks Adrian and David. That all makes sense, and I gather the answer
> regarding the existing dumps is "no, they can't be restored." So be
> it. Here's a couple of follow-on comments::
>
> Ideally figure out how to write an actual FK constraint - otherwise
> use triggers.
>
>
> I can't really make this an FK. I can (and probably will) put this into
> a trigger. Although it seems like an extra layer of wrapping just to
> call a function. I'm curious if there's any conceptual reason why
> constraints couldn't (as an option) be restored after all the data is
> loaded, and whether there would be any negative consequences of that? I
> could see if your data still didn't pass the CHECKs, it's already
> loaded. But the constraint could then be marked not valid?

Not sure why just know that if I stay within the guidelines it works, if
I do not its does not work:)

>
>
> -1; pg_dump should not be trying to restore things.​ The core
> developers shouldn't really concern themselves with the various and
> sundry ways people might want to setup such a process. You have
> tools for dump, and tools for restore, and you can combine them in
> whatever fashion you deem useful. Or otherwise acquire someone
> else's ideas.
>
>
> I get that as a general principle. OTOH, being able to restore your
> backups isn't just a random or inconsequential feature. I have access
> to the superuser and can create DBs, but users in more locked down
> scenarios might not be able to do so.
>

See that, but in your scenario you wanted to create a 'scratch' database
so you are back to a user with privileges. Then there is the whole
overhead of doing a restore twice. Basically, if you have no way to test
your backup/restore procedure before hand you are flying blind.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ken Tanzer 2017-06-06 00:59:50 Re: Help with restoring a dump in Tar format? (dependencies/ordering)
Previous Message John R Pierce 2017-06-06 00:52:02 Re: Help with restoring a dump in Tar format? (dependencies/ordering)