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

Re: indexes on functions and create or replace function

From: "Matthew Dennis" <mdennis(at)merfer(dot)net>
To: Christophe <xof(at)thebuild(dot)com>
Cc: "PGSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: indexes on functions and create or replace function
Date: 2008-08-29 02:22:57
Message-ID: e94d85500808281922s79f73b9cudeb24f32dd3b32ad@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, Aug 28, 2008 at 9:01 PM, Christophe <xof(at)thebuild(dot)com> wrote:

>
> On Aug 28, 2008, at 6:51 PM, Alvaro Herrera wrote:
>
>> Also, you have to keep in mind that we support pluggable languages.  The
>> function's source code is just an opaque string.
>>
>
> Oh, ouch, right.
>
> I think that this is one of those cases where it's better that we simply
> advertise: BE AWARE OF THIS, rather than try to provide a half-baked
> solution that gives the illusion of safety without the reality.


Yes, but in the case of pluggable languages, you still load something that
constitutes the "source".  In the case of PL/Java, the jar for example.
Whenever it changes, the stuff that depends on it up the chain is
invalidated/rechecked/whatever.  When I have a table that a view references,
it tracks that.  When I have a function that a index references, it kind of
tracks that (I can't drop it because of the dependency, but I can replace it
- with no warning/error btw).  It just seems a worthy goal to aspire to...

The cases about taking a string and sending it via execute don't seem to fit
here for 1) cases where it is impossible to track the dependencies can be
trivially constructed and 2) the very nature of the execute statement makes
it obvious that it I shouldn't expect it to be tracked.  Poor Analogy: In C,
if foo calls bar and I remove bar I expect the compiler to tell me.  If
elsewhere in my code, I construct a memory address of where I believe bar
should be and execute it I have no expectations for the compiler to tell me
bar was removed.

In response to

Responses

pgsql-general by date

Next:From: Matthew DennisDate: 2008-08-29 02:27:17
Subject: Re: indexes on functions and create or replace function
Previous:From: Greg SmithDate: 2008-08-29 02:13:35
Subject: Re: WAL archiving to network drive

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