Thread: downgrading a database

downgrading a database

From
Heine Ferreira
Date:
Hi

Is it possible to downgrade a Postgresql database from a
newer to an older version?
If so how do you do it?
Let's assume you are not using any features in the
newer version.
Say from 9.2 to 9.1.

Thanks

H.F.

Re: downgrading a database

From
Andreas Kretschmer
Date:
Heine Ferreira <heine.ferreira@gmail.com> wrote:

> Hi
>
> Is it possible to downgrade a Postgresql database from a
> newer to an older version?
> If so how do you do it?
> Let's assume you are not using any features in the
> newer version.
> Say from 9.2 to 9.1.

You can try it with an ascii-dump.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


Re: downgrading a database

From
Adrian Klaver
Date:
On 12/23/2012 08:54 AM, Heine Ferreira wrote:
> Hi
>
> Is it possible to downgrade a Postgresql database from a
> newer to an older version?
> If so how do you do it?
> Let's assume you are not using any features in the
> newer version.
> Say from 9.2 to 9.1.

Would need to be done as a test first.

I just tried it from 9.2 --> 9.0 and it worked with one exception

Lessons learned.

1) First pg_dump will not dump forward. In other words you cannot use
the 9.1 version to dump a 9.2 database. You will need to use the 9.2
version. This means it may include new syntax not understood by 9.1 even
if you do not make use of new features.

2) The exception was CREATE EXTENSION for plpgsql. The switch over from
CREATE LANGUAGE to CREATE EXTENSION for languages took place in 9.1, so
this should not bite you.

3) I did the dump as -Fc. Remember you can always create a text version
of a custom format dump by using the -f option to pg_restore to restore
to a file instead of a database.




>
> Thanks
>
> H.F.
>


--
Adrian Klaver
adrian.klaver@gmail.com


Re: downgrading a database

From
Andrew Sullivan
Date:
In addition to the other suggestions, you can do this with Slony.  It
was one of its use cases.

A

On Sun, Dec 23, 2012 at 06:54:49PM +0200, Heine Ferreira wrote:
> Hi
>
> Is it possible to downgrade a Postgresql database from a
> newer to an older version?
> If so how do you do it?
> Let's assume you are not using any features in the
> newer version.
> Say from 9.2 to 9.1.
>
> Thanks
>
> H.F.

--
Andrew Sullivan
ajs@crankycanuck.ca