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:27:17
Message-ID: e94d85500808281927h117ec9e6k7e2accd151ce6176@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, Aug 28, 2008 at 9:09 PM, Christophe <xof(at)thebuild(dot)com> wrote:

>
> On Aug 28, 2008, at 7:04 PM, Matthew Dennis wrote:
>
>> The plpgsql execute statement, as I understand it, means "take this string
>> and execute like a client sent it to you".
>>
>
> Of course, the string could come from anywhere. There's no inherent reason
> that I can think of (except good taste) that you could not write a function
> that retrieved a string out of a field in a table, executed it, and returned
> that as a value for use in an index.  The client didn't send the string
> along, but it still creates dependencies.
>
> Anyway, as was correctly pointed out, tracking dependencies in PL/pgSQL is
> bad enough, but PL/Java, PL/Perl...
>
>
Actually because reading the string from a table prevents the function from
being immutable (it could be stable), it could not be used in an index.
However, you're right though that where the string came from is really not
important.  My point is that nobody would have expectations of execute
tracking dependencies of the sql it executes for the same reason nobody has
expectations that sql that lives in application code will have it's
dependencies tracked by PG...

In response to

pgsql-general by date

Next:From: ChristopheDate: 2008-08-29 02:33:53
Subject: Re: indexes on functions and create or replace function
Previous:From: Matthew DennisDate: 2008-08-29 02:22:57
Subject: Re: indexes on functions and create or replace function

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