Re: Dropping PL language retains support functions

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dropping PL language retains support functions
Date: 2012-03-06 15:16:29
Message-ID: 20120306151629.GB15997@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 05, 2012 at 11:38:33PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > By doing a DROP CASCADE on plpython2, you drop the user functions, but
> > not the support functions.
>
> Well, yeah. The language depends on the support functions, not the
> other way around.
>
> > This certainly looks like a bug. Should I work on a patch?
>
> It's not a bug, and it's unlikely you can "fix" it in pg_upgrade without
> making things worse.
>
> The long-run plan is that the procedural language and its support
> functions are all part of an extension and what you do is drop the
> extension. We're not quite there yet. As of 9.1, if you do "create
> extension plpython2" to start with, dropping the extension does drop the
> support functions too ... but if you use the legacy "create language"
> syntax, that doesn't happen, because an extension object isn't created.

Well, if CREATE LANGUAGE created those functions, it seems logical that
DROP FUNCTION removes them. Why is that not a bug? I am not saying we
have to fix it, but sure seems like a bug to me. Are you saying other
objects might rely on those functions?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-03-06 15:21:19 Re: elegant and effective way for running jobs inside a database
Previous Message Tom Lane 2012-03-06 15:12:35 Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)