| From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | pgsql-general(at)postgresql(dot)org, Andreas Laggner <andreas(dot)laggner(at)vti(dot)bund(dot)de> |
| Subject: | Re: Upgrading 8.2 to 8.4: pg_restore: did not find magic string in file header\n |
| Date: | 2010-11-20 03:03:06 |
| Message-ID: | 201011191903.09392.adrian.klaver@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Friday 19 November 2010 2:45:33 pm Tom Lane wrote:
> Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> writes:
> > Now I understand. I wonder if this would be a good time to ask about
> > whether pg_restore could be made to work with plain-text files:)
>
> Not in any particularly useful way --- the plain text dump wouldn't
> really support selective restore, etc etc.
True, but I was thinking of something like:
if $FILE_TYPE = plain_text
echo 'This is a plain text file it will be passed to psql'
echo 'It does not support all the features of a binary restore'
dialog 'Do you wish to continue yes/no>'
if yes
psql $OPTIONS -f $FILE_NAME
else
exit
# Where $OPTIONS are the -d -p -U and -h switches
else
continue with existing code path
>
> > ... Though I could see a shortcut that passes a plain text file to
> > psql or at least creates an error message that says:
> >
> > "Please use psql with the -f option to restore this file"
>
> Yeah, I was thinking a hint might be the most useful fix too.
That would help also.
>
> regards, tom lane
Thanks,
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rob Brown-Bayliss | 2010-11-20 05:41:29 | Cancel a query. |
| Previous Message | Ivan Voras | 2010-11-20 00:06:36 | Re: Best practice to get performance |