Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME

Поиск
Список
Период
Сортировка
От silly sad
Тема Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Дата
Msg-id 4BEA4415.2000902@bankir.ru
обсуждение исходный текст
Ответ на Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME  (Torsten Zühlsdorff <foo@meisterderspiele.de>)
Список pgsql-sql
On 05/11/10 18:26, Torsten Zühlsdorff wrote:
>
>
> Tom Lane schrieb:
>> Torsten Zühlsdorff <foo@meisterderspiele.de> writes:
>>> NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
>>
>>> /* not working line, just a stub:
>>> EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
>>> */
>>
>>> RETURN NULL;
>>
>> This seems like the hard way. Why don't you just RETURN NEW and let the
>> normal insertion happen?
>
> The trigger catches an UPDATE, not an INSERT. I need the old and the new
> row, because this should emulate revision-control of the content.

just set whatever value u want to the fields of the row NEW.


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: best paging strategies for large datasets?
Следующее
От: "Gnanakumar"
Дата:
Сообщение: Invalid message format Exception