Re: [HACKERS] Adding "eval" to pl?

Поиск
Список
Период
Сортировка
От wieck@debis.com (Jan Wieck)
Тема Re: [HACKERS] Adding "eval" to pl?
Дата
Msg-id m10yenG-0003ktC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на Adding "eval" to pl?  (Adriaan Joubert <a.joubert@albourne.com>)
Список pgsql-hackers
>
> Hi,
>
>    I have a problem where an action in a PL function depends on a table
> which is determined at run-time. So the steps are the following:
>
> 1. trigger gets passed a row
> 2. table name is looked up in a reference table, depending on a field in
> row
> 3. rows are deleted from the table
>
> In PL this cannot be done, as the execution plans are built once, so
> that the tables are fixed. The only PL solution I've come up with is a
> giant IF-THEN-ELSE statements, which is not terribly practical and hard
> to change.

    This  is  entirely true for PL/pgSQL. But it isn't for PL/Tcl
    where  you   have   control   over   which   statements   get
    prepared/saved and which not.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #

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

Предыдущее
От: "Oliver Elphick"
Дата:
Сообщение: Re: [HACKERS] Perl library (was Building Postgres)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Perl library (was Building Postgres)