Re: pg_dumpall -> fails - Mailing list pgsql-general

From Oliver Elphick
Subject Re: pg_dumpall -> fails
Date
Msg-id 200102281252.f1SCqAH15843@linda.lfix.co.uk
Whole thread Raw
In response to pg_dumpall -> fails  (will trillich <will@serensoft.com>)
Responses Re: pg_dumpall -> fails
List pgsql-general
will trillich wrote:
  >so i've got my data recovered (thanks to oliver) and now
  >i wanna back it up with a pg_dumpall...
  >
  >instead, i get 'failed sanity check, type with oid 779927 was no
  >found' in the oddest places...

More than 1 place?

  >CREATE FUNCTION "get_failed sanity check, type with oid 779927 was not found
  >disid" (text,text ) RETURNS int4 AS '
  >    SELECT
  >        get_disid( get_eduid($1), $2 )
  >    ;
  >' LANGUAGE 'SQL';
  >[snip]
  >
  >CREATE FUNCTION "get_studentid" (varchar ) RETURNS int4 AS '
  >    SELECT
  >        who
  >    FROM
  >        _student
  >    WHERE
  >        _student.who = _who.id
  >        AND
  >        _who.login = $1;
  >' LANGUAGE 'SQL';
  >\connect - will
  >pg_dump failed on ed, exiting
  >
  >
  >so what does 'sanity check' mean, and why does it appear
  >in the middle of 'get_disid'?

pg_dump is dumping your functions and for each function it looks up
the argument type by the oid of the type.  For one function there
is a type whose oid is 779927, but there is no row in pg_type with
that oid.

I don't think that get_disid(text,text) is necessarily the
culprit, because the routine aborts pg_dump as soon as it hits that
error (src/bin/pg_dump/common.c:findTypeByOid()), whereas you seem
to be getting a lot of text after the error.  I suspect that
stderr is getting sent and then the stdout buffer is flushed as
the program exits.

Look in pg_proc for a function that tries to use a type of 779927:

 select proname, proargtypes, prorettype from pg_proc;

That will be the one that is causing the problem.  (Of course the
next question is how it got that way.)

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "These things have I written unto you that believe on
      the name of the Son of God; that ye may know that ye
      have eternal life, and that ye may believe on the name
      of the Son of God."        I John 5:13



pgsql-general by date:

Previous
From: Renaud Tthonnart
Date:
Subject: Re: Object
Next
From: Juan Ramón Cortabitarte
Date:
Subject: store procedure in pl/pgsql