Thread: Fwd: getInherits(): SELECT failed.

Fwd: getInherits(): SELECT failed.

From
Nigel Gilbert
Date:
I sent the message below to the list last Thursday and received not
one single reply!  Is there no one who could give me any help? Even
'this is the wrong list, send your query to XXX' would be useful.

Yours in hope,

Nigel Gilbert


>  >From n.gilbert@soc.surrey.ac.uk  Thu Jul 26 23:49:27 2001
>Date: Thu, 26 Jul 2001 23:49:46 +0100
>From: Nigel Gilbert <n.gilbert@soc.surrey.ac.uk>
>To: pgsql-general@postgresql.org
>Subject: getInherits(): SELECT failed.
>X-AntiVirus: scanned for viruses by AMaViS 0.2.0-pre6
>(http://aachalon.de/AMaViS/)
>Status: RO
>
>I have inherited a database apparently set up using postgres7.0.2.
>I now want to dump the database in preparation for tidying up and
>upgrading to the current version of postgresql.  However, pg_dumpall
>gives:
>
>pg_dumpall >db.out
>getInherits(): SELECT failed.  Explanation from backend: 'ERROR:
>Attribute 'inhrel' not found
>'.
>
>A previous message in this list proposed that this error was
>generated when a version 6 database is dumped using version 7
>software.  I think this is unlikely to be the explanation here (for
>example, psql 7.0.2 reads the database without complaint), but it is
>a possibility.  My questions for the list:
>
>1. How do I find the version numbers of (a) the database and (b) the
>pg_dump code, given that I am not certain about their past history.
>
>2.  More importantly, how do I work around the error, so that I can
>dump the database and move up to version 7.1?
>
>Cheers,
>
>Nigel

--
_________________________________________________________________________
Prof Nigel Gilbert, FREng AcSS, Dept. of Sociology, University of Surrey,
  Guildford GU2 7XH, UK.  Tel: +44 (0)1483 259173 Fax: +44 (0)1483 259551

Re: Fwd: getInherits(): SELECT failed.

From
Tom Lane
Date:
Nigel Gilbert <N.Gilbert@soc.surrey.ac.uk> writes:
>> I have inherited a database apparently set up using postgres7.0.2.
>> I now want to dump the database in preparation for tidying up and
>> upgrading to the current version of postgresql.  However, pg_dumpall
>> gives:
>>
>> pg_dumpall >db.out
>> getInherits(): SELECT failed.  Explanation from backend: 'ERROR:
>> Attribute 'inhrel' not found
>> '.
>>
>> A previous message in this list proposed that this error was
>> generated when a version 6 database is dumped using version 7
>> software.  I think this is unlikely to be the explanation here (for
>> example, psql 7.0.2 reads the database without complaint), but it is
>> a possibility.

I can assure you that that is a pg_dump-versus-backend version mismatch
problem: pg_dump is expecting a different layout of system catalog
tables than what it's actually finding.

I think that particular failure is the symptom of pre-7.0 pg_dump used
on a 7.0 database, but don't recall for sure.  In any case, check which
instance of pg_dump you're invoking.

            regards, tom lane

PS: yes, we have wised up since then --- recent pg_dump releases check
"select version()" before doing much else...

Re: Fwd: getInherits(): SELECT failed.

From
Richard Huxton
Date:
Nigel Gilbert wrote:
>
> I sent the message below to the list last Thursday and received not
> one single reply!  Is there no one who could give me any help? Even
> 'this is the wrong list, send your query to XXX' would be useful.
>
> >I have inherited a database apparently set up using postgres7.0.2.
> >I now want to dump the database in preparation for tidying up and
> >upgrading to the current version of postgresql.  However, pg_dumpall
> >gives:
> >
> >pg_dumpall >db.out
> >getInherits(): SELECT failed.  Explanation from backend: 'ERROR:
> >Attribute 'inhrel' not found

Try "psql -l" to list databases and then "pg_dump" each database
individually - see if that gets you any further (that's just guesswork).


> >A previous message in this list proposed that this error was
> >generated when a version 6 database is dumped using version 7
> >software.  I think this is unlikely to be the explanation here (for
> >example, psql 7.0.2 reads the database without complaint), but it is
> >a possibility.  My questions for the list:
> >
> >1. How do I find the version numbers of (a) the database and (b) the
> >pg_dump code, given that I am not certain about their past history.

Try "psql -V", "pg_dump -V" and "select version();" if you want to see
the versions of the various bits of front and backend.

You may find it useful to run "which pg_dump" to see which executable is
running - you may have two.

> >2.  More importantly, how do I work around the error, so that I can
> >dump the database and move up to version 7.1?

Well - if psql works you can always get the data out that way. Not
perfect but it'll do it. We'll see if we can't figure out the problem
with pg_dump first.

- Richard Huxton