Skip site navigation (1) Skip section navigation (2)

Re: Creating Functions & Triggers

From: "V i s h a l Kashyap (at) [Sai Hertz And Control Systems]" <sank89(at)sancharnet(dot)in>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Creating Functions & Triggers
Date: 2004-03-21 04:08:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Dear Kevin ,

>>        UPDATE email SET  m_date = current_date, m_by_user = current_user
>>        WHERE id =;
>>  END;
>> 'LANGUAGE 'plpgsql';
>> This must do the job.
> Thanks for the suggestion, unfortunately it still hangs when I try and 
> update a record.
>> 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;

I am doing this thing in  PostgreSQL 7.4.2

> Sorry for the basic questions, but I'm quite new to this.

Its ok, read above
Kindly pas on the query you are issuing .

Best Regards,
Vishal Kashyap
Director / Lead Developer,
Sai Hertz And Control Systems Pvt Ltd,
Jabber IM: vishalkashyap(at)jabber(dot)org
ICQ :      264360076
Yahoo  IM: mailforvishal(at)yahoo(dot)com
You yourself, as much as anybody in the entire
universe, deserve your love and affection.
- Buddha
pgsql=# select marital_status from vishals_life;

Single not looking

1 Row(s) affected

                  ( 0_0 )


pgsql-novice by date

Next:From: Kevin LohkaDate: 2004-03-21 04:51:47
Subject: Re: Creating Functions & Triggers
Previous:From: V i s h a l Kashyap @ [Sai Hertz And Control Systems]Date: 2004-03-21 03:30:25
Subject: Re: Creating Functions & Triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group