Re: Creating Functions & Triggers

Поиск
Список
Период
Сортировка
От Kevin Lohka
Тема Re: Creating Functions & Triggers
Дата
Msg-id 75A68416-7AF3-11D8-9E77-000A95728606@aboutfacedata.ab.ca
обсуждение исходный текст
Ответ на Re: Creating Functions & Triggers  ("V i s h a l Kashyap @ [Sai Hertz And Control Systems]" <sank89@sancharnet.in>)
Ответы Re: Creating Functions & Triggers  ("V i s h a l Kashyap @ [Sai Hertz And Control Systems]" <sank89@sancharnet.in>)
Список pgsql-novice
On Saturday, March 20, 2004, at 09:08 PM, V i s h a l Kashyap @ [Sai
Hertz And Control Systems] wrote:
>>
>>
>>> But why you need a trigger for all this.
>>>
>>> Just use a default value for the respective column's .
>>
>>
>> Isn't the default value only used during the initial insert of a
>> record?  How would I set the default value for an UPDATE only?
>
> Yes, you can set the default value for update of a record
> just with
>
> UPDATE email SET  m_date = DEFAULT, m_by_user = DEFAULT  WHERE id =
> some_id;

If I use this method, I will need to control the input from the client
side.  I was hoping to have an easy way to update the record with the
last date modified and user who modified the record regardless of where
the modification came from.  eg. Web or internal client software.
>
> I am doing this thing in  PostgreSQL 7.4.2

I'm using PostgreSQL 7.4.1 on Mac OS X 10.2.8
>
> Kindly pas on the query you are issuing .
>

acc=# UPDATE email SET email_address = 'mynewusername@mydomain.com'
WHERE id = 14;
-------------
UPDATE 1

Thank you for your time Vishal.

Kevin Lohka


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

Предыдущее
От: "V i s h a l Kashyap @ [Sai Hertz And Control Systems]"
Дата:
Сообщение: Re: Creating Functions & Triggers
Следующее
От: "V i s h a l Kashyap @ [Sai Hertz And Control Systems]"
Дата:
Сообщение: Re: Creating Functions & Triggers