Обсуждение: BUG #4699: pg_restore hangs with incorrect file format

Поиск
Список
Период
Сортировка

BUG #4699: pg_restore hangs with incorrect file format

От
"Scott Reed"
Дата:
The following bug has been logged online:

Bug reference:      4699
Logged by:          Scott Reed
Email address:      sreed@avacoda.com
PostgreSQL version: 8.3
Operating system:   Windows XP
Description:        pg_restore hangs with incorrect file format
Details:

"pg_restore <filename>" hangs if the file format is not one of the
non-plain-text formats created by pg_dump. There does not appear to be a log
or error message to explain what is happening. Apparently this also causes
the OK button to be disabled in the pgAdmin Restore dialog, again without
any explanation, even though the file has been created using the pgAdmin
Backup dialog (albeit in plain-text format).

My suggestions for a fix is to have pg_restore return an error if the file
format is incorrect.

Carry over to pgAdmin:
1) in the pgAdmin Backup dialog only display the last file used if 1) the
file name has the default file extension for the selected format or b) the
selected format matches the format used when backing up to the last file.
2) in the pgAdmin Restore dialog display the error message from pg_restore
(see pg_restore suggested fix) when the file format is incorrect to explain
why the OK button is disabled.

Re: BUG #4699: pg_restore hangs with incorrect file format

От
Tom Lane
Дата:
"Scott Reed" <sreed@avacoda.com> writes:
> "pg_restore <filename>" hangs if the file format is not one of the
> non-plain-text formats created by pg_dump.

When I try to reproduce this I get
pg_restore: [archiver] input file does not appear to be a valid archive

Perhaps there are specific cases where it gets confused, but you'll need
to submit a sample file for us to poke at.

Another possible explanation is that this is a bug that's been fixed
since whichever 8.3.x release you are using (which you didn't specify,
tut tut).

            regards, tom lane

Re: BUG #4699: pg_restore hangs with incorrect file format

От
Scott Reed
Дата:
Tom,
 My apologies for wasting your time. I wasn't calling pg_restore as I'd
described but with the -f flag so of course it was hanging waiting for
input. I hope my embarrassment is sufficient punishment.
 Would you accept the second part of that post about handling the file
name in pgAdmin Backup and Restore? I will resubmit if you think it
would be useful.
   Scott

Tom Lane [3/10/2009 3:43 PM] wrote:
> "Scott Reed" <sreed@avacoda.com> writes:
> > "pg_restore <filename>" hangs if the file format is not one of the
> > non-plain-text formats created by pg_dump.
>
> When I try to reproduce this I get
> pg_restore: [archiver] input file does not appear to be a valid archive
>
> Perhaps there are specific cases where it gets confused, but you'll need
> to submit a sample file for us to poke at.
>
> Another possible explanation is that this is a bug that's been fixed
> since whichever 8.3.x release you are using (which you didn't specify,
> tut tut).
>
>             regards, tom lane
>
>

Re: BUG #4699: pg_restore hangs with incorrect file format

От
Tom Lane
Дата:
Scott Reed <sreed@avacoda.com> writes:
>  Would you accept the second part of that post about handling the file
> name in pgAdmin Backup and Restore? I will resubmit if you think it
> would be useful.

You'd need to bug the pgAdmin folks about that; that's a separate
project with its own mailing lists.

            regards, tom lane

Re: BUG #4699: pg_restore hangs with incorrect file format

От
Alvaro Herrera
Дата:
Tom Lane wrote:
> Scott Reed <sreed@avacoda.com> writes:
> >  Would you accept the second part of that post about handling the file
> > name in pgAdmin Backup and Restore? I will resubmit if you think it
> > would be useful.
>
> You'd need to bug the pgAdmin folks about that; that's a separate
> project with its own mailing lists.

I wonder if it would be worth it to add a mention of this in the bug
reporting form.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support