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

Re: Dropping a broken function

From: "Joonas Makkonen" <joonas(dot)makkonen(at)infosto(dot)fi>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Dropping a broken function
Date: 2000-11-14 15:45:52
Message-ID: 032701c04e52$0c40c4f0$e62689c2@infosto.fi (view raw or flat)
Thread:
Lists: pgsql-novice
Thanks, that worked.

    -j

----- Original Message ----- 
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joonas Makkonen" <joonas(dot)makkonen(at)infosto(dot)fi>
Cc: <pgsql-novice(at)postgresql(dot)org>
Sent: Tuesday, November 14, 2000 5:47 PM
Subject: Re: [NOVICE] Dropping a broken function 


"Joonas Makkonen" <joonas(dot)makkonen(at)infosto(dot)fi> writes:
> 1) a type 'lo' was created
> 2) a function lo_oid(lo) was created
> 3) type 'lo' was dropped

Yeah, there's no interlock against that :-(

> Now the function cannot be dropped and the broken function is preventing
> dumping the db.

Find out the OID of the function, eg with

select oid,* from pg_proc where proname = 'lo_oid';

and then zap its pg_proc entry by OID:

delete from pg_proc where oid = whatever;

(Actually, any other unique WHERE condition will do, but OID is usually
the most reliable way, particularly for functions where there can be
multiple items with the same name.)

You'll need to be logged in as superuser to do this DELETE, of course.

regards, tom lane


In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2000-11-14 15:47:12
Subject: Re: Dropping a broken function
Previous:From: Mark, TerryDate: 2000-11-14 15:33:34
Subject: Renaming a database ?

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