Backup/Restore round-tripping

From: Vik Reykja <vikreykja(at)gmail(dot)com>
To: PgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Backup/Restore round-tripping
Date: 2012-03-16 09:25:20
Message-ID: CALDgxVsAR04T24XyMkAhd-YVo6vKNYP3gxfA56Orqm8whVR0cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

I was helping someone restore a dump on Windows yesterday on IRC and the
Restore button stayed disabled. I'd never had that problem before so I
quickly created a new database, dumped it, and tried to restore it. I, too,
got the disabled Restore button.

Nothing I tried worked so I went into the source code to see what was up
and saw the test for custom format. I checked my test dump and indeed it
was plain.

I don't know if you've ever tried to restore a dump through psql on the
Windows command line but it's not easy, especially if you have non-ascii
data. I propose a couple different solutions to make this situation better:

1- Don't disable the Restore button[1] or provide another means of letting
the user know why restoration is not possible.
2- Automatically use psql when a plain dump is encountered. Guillaume
Lelarge says the project doesn't want to package psql to avoid bloat.
That's fine, but its presence can be tested for in "PG bin path" and used
if found.
3- Make "custom" the default option when dumping. For a know-nothing
newbie, dumping using the default options and immediately restoring using
the default options should Just Work. Today it doesn't.
4- Allow pgAdmin to stream a file to the server. COPY can do this but I
haven't looked into how exactly. This avoids having to open the plain dump
in the sql editor which for any reasonably sized database will take forever
and then die horribly (I've tried it).

[1] http://www.joelonsoftware.com/items/2008/07/01.html

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message plop plop 2012-03-16 13:23:46 Pgscript : error creating a user with a variable as the password
Previous Message MrTeeth 2012-03-15 23:19:58 Re: Primary & Foreign Keys in pgAdmin