Re: function to update different tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: function to update different tables
Дата
Msg-id 26018.1099879691@sss.pgh.pa.us
обсуждение исходный текст
Ответ на function to update different tables  ("Lars Eckberg" <le@eckbergconsulting.com>)
Список pgsql-novice
"Lars Eckberg" <le@eckbergconsulting.com> writes:
> I'm trying to create a function, where the first parameter will be the
> tablename to update.

There is no way to do that in an SQL-language function.  If you use
plpgsql then it's possible to construct an SQL command as a string
(ie, concatenate the constant parts with the table name) and then
execute it with an EXECUTE statement.

            regards, tom lane

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

Предыдущее
От: "Lars Eckberg"
Дата:
Сообщение: function to update different tables
Следующее
От:
Дата:
Сообщение: Pgsql install