Skip site navigation (1) Skip section navigation (2)

Re: Should pg_dump refuse to run if DB has different version?

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Should pg_dump refuse to run if DB has different version?
Date: 2000-04-03 19:32:51
Message-ID: 20000403123251.T21029@fw.wintelcom.net (view raw or flat)
Thread:
Lists: pgsql-hackers
* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [000403 12:18] wrote:
> If you run 6.5 pg_dump against a 7.0 database, or vice versa,
> you get very obscure error messages:
> 	parseNumericArray: too many numbers
> 	getInherits(): SELECT failed.  Explanation from backend: 'ERROR:  Attribute 'inhrel' not found
> (Quick, guess which is which ... you'll probably guess wrong.)
> 
> It's too late to do anything about the behavior of 6.5 pg_dump,
> but we could change 7.0 and later pg_dump to check the database
> version at startup and refuse to run if it's not the expected value.
> 
> A downside is that a pg_dump might refuse to dump a DB that it actually
> would work with; that could be a pain in the neck, particularly in
> development scenarios where you might not have kept the previous
> compilation of pg_dump lying around.  Yet I think I prefer that to the
> risk of an insidious incompatibility that causes pg_dump to run without
> complaint yet generate a bogus dump.
> 
> Comments anyone?

It's a great idea and later down the road the versioning information
could be used to determine if it's actually possible to pg_dump
with a certain version, ie the pg_dump program can report its
version number to postgresql and postgresql can reply if it thinks
it's compatible with the version of pg_dump being used.

-- 
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-04-03 20:49:11
Subject: Re: BIT datatype (Fixed)
Previous:From: The Hermit HackerDate: 2000-04-03 19:02:31
Subject: Re: Should pg_dump refuse to run if DB has different version?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group