Re: Function Missing? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Function Missing?
Date
Msg-id 19755.983807089@sss.pgh.pa.us
Whole thread Raw
In response to Function Missing?  (Luke Tudor - RSG <ltt@pml.ac.uk>)
List pgsql-novice
Luke Tudor - RSG <ltt@pml.ac.uk> writes:
> Should this function 'check_foreign_key' appear on the list?

Not unless you installed the contrib/spi/refint module.  IMHO that
module is really obsolete at this point; you should consider using the
standard FOREIGN KEY support instead...

> Is this the way to display it?

Just FYI, \df is a tad selective about what it will display.  If you
think it's omitting something interesting, try a direct query on
pg_proc, eg:

    select * from pg_proc where proname like '%foo%';

> and lastly, Am I correct in thinking that functions have oid's as well
> as field rows. Or could this error actually
> be due to missing some data from a table? (This backup program has
> worked before, but has just stopped working!?)

The problem evidently is that a function that was used as a trigger got
dropped.  You will need to reinstall the function *and* drop/recreate
the triggers that depend on it.  The reinstalled function will not have
the same OID, and the triggers refer to the function by OID not name,
so the existing triggers are hopelessly busted.

Some day there will probably be a crosscheck to keep people from
dropping functions &etc that are still referenced...

            regards, tom lane

pgsql-novice by date:

Previous
From: Luke Tudor - RSG
Date:
Subject: Function Missing?
Next
From: Chris
Date:
Subject: Re: I can't even get started..... HELP!!!