Обсуждение: Restoring 8.2 to 8.0

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

Restoring 8.2 to 8.0

От
Robert Fitzpatrick
Дата:
I have a dump from 8.2 restored to file that was pg_dump'd with format c
from a production server. I want to know if it is possible for me to
restore this to a 8.0 development server where I am not able to upgrade
at this time. Trying to do some testing, but this is the only other
server that's available right now. I tried a normal restore and start
getting errors relating to regclass:

honeypot:~ # psql -U postgres trax < pgtrax.sql
<snip>
ERROR:  cannot cast type text to regclass
ERROR:  relation "public.tblmenu" does not exist
ERROR:  function nextval(regclass) does not exist

Is there a way I can prepare my dump to work? There is a lot of data, so
I need to maintain COPY methods of inserting.

--
Robert


Re: Restoring 8.2 to 8.0

От
RW
Дата:
I've never tried this but maybe it works if you use pg_dump
from 8.0 to do the dump.

Greetings
Robert

Robert Fitzpatrick wrote:
> I have a dump from 8.2 restored to file that was pg_dump'd with format c
> from a production server. I want to know if it is possible for me to
> restore this to a 8.0 development server where I am not able to upgrade
> at this time. Trying to do some testing, but this is the only other
> server that's available right now. I tried a normal restore and start
> getting errors relating to regclass:
>
> honeypot:~ # psql -U postgres trax < pgtrax.sql
> <snip>
> ERROR:  cannot cast type text to regclass
> ERROR:  relation "public.tblmenu" does not exist
> ERROR:  function nextval(regclass) does not exist
>
> Is there a way I can prepare my dump to work? There is a lot of data, so
> I need to maintain COPY methods of inserting.
>
>


Re: Restoring 8.2 to 8.0

От
Robert Fitzpatrick
Дата:
On Fri, 2007-06-01 at 19:24 +0200, RW wrote:
> I've never tried this but maybe it works if you use pg_dump
> from 8.0 to do the dump.
>
> Greetings
> Robert
>
> Robert Fitzpatrick wrote:
> > I have a dump from 8.2 restored to file that was pg_dump'd with format c
> > from a production server. I want to know if it is possible for me to
> > restore this to a 8.0 development server where I am not able to upgrade
> > at this time. Trying to do some testing, but this is the only other
> > server that's available right now. I tried a normal restore and start
> > getting errors relating to regclass:
> >
> > honeypot:~ # psql -U postgres trax < pgtrax.sql
> > <snip>
> > ERROR:  cannot cast type text to regclass
> > ERROR:  relation "public.tblmenu" does not exist
> > ERROR:  function nextval(regclass) does not exist
> >
> > Is there a way I can prepare my dump to work? There is a lot of data, so
> > I need to maintain COPY methods of inserting.

Thanks for the idea, but it didn't work. It warned me when trying, I had
to add the -i option to make it dump and I am getting the same ERROR's.

--
Robert


Re: Restoring 8.2 to 8.0

От
Tom Lane
Дата:
Robert Fitzpatrick <lists@webtent.net> writes:
> I have a dump from 8.2 restored to file that was pg_dump'd with format c
> from a production server. I want to know if it is possible for me to
> restore this to a 8.0 development server where I am not able to upgrade
> at this time.

I don't think you'll have much alternative but to manually edit the dump
file.  If I were you I'd dump the schema as text, hack it until it
loads, then do a data-only dump in Fc or whatever format you want.

FWIW the specific errors you're mentioning have to do with SERIAL
columns, so if that's all you're seeing then it should be a pretty
simple set of edits.

You might want to divvy up the schema into stuff to apply before the
data load and stuff to apply after --- indexes and foreign keys go in
the latter set.  See the performance tips about "populating a database".

            regards, tom lane