Re: indexes on functions and create or replace function

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: indexes on functions and create or replace function
Дата
Msg-id 20080829015122.GI8424@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: indexes on functions and create or replace function  (Christophe <xof@thebuild.com>)
Ответы Re: indexes on functions and create or replace function  (Christophe <xof@thebuild.com>)
Re: indexes on functions and create or replace function  ("Matthew Dennis" <mdennis@merfer.net>)
Список pgsql-general
Christophe wrote:
>
> On Aug 28, 2008, at 6:10 PM, Matthew Dennis wrote:
>> I'm not sure I follow.  Couldn't you track which statements were
>> prepared that called a function and either reprepare (just like
>> reindex, recheck, etc) or in the case of dropping a function, refuse to
>> drop it because something depends on it?
>
> EXECUTE in PL/pgSQL accepts a string and executes it as a statement.
> (That's different from the SQL-level EXECUTE.) I'm not sure how one
> would track dependencies there.

There's no way at all in the general case (a function name could be
passed as a parameter, for example).  I think Matthew is suggesting to
track dependencies at run time, but that seems a recipe for burnt
fingers and an overall performance loss, for what seems a dubious gain.

Also, you have to keep in mind that we support pluggable languages.  The
function's source code is just an opaque string.  It could be anything.
I doubt anyone uses PL/LOLCODE functions in production, but PL/Java
functions are more likely, and for these we only have a class and method
name, and little else.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

В списке pgsql-general по дате отправления:

Предыдущее
От: Christophe
Дата:
Сообщение: Re: indexes on functions and create or replace function
Следующее
От: Christophe
Дата:
Сообщение: Re: indexes on functions and create or replace function