From: | Dan McGrath <dmcgrath19(at)home(dot)com> |
---|---|
To: | Dave Wedwick <news(at)wedwick(dot)com> |
Subject: | Re: Trigger question |
Date: | 2001-02-14 23:20:09 |
Message-ID: | 3A8B12A9.416F51A3@home.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Actually, a default of now() would be perfectly providing you created a rule to
trap insert's and updates and remove the setting for that time/date from being
inserted so as to have the db use the dfault which I think is far easier that
making a silly trigger for something so simple.
Dan
Dave Wedwick wrote:
> One person suggested setting now() as default.
>
> That would work sometimes, but I have a situation where the user program is
> updating the default field with 0. now() never gets into the field.
>
> So, regardless of what the user enters, I want now() to be updated, and I
> guess it would be via a trigger...
>
> Thanks!
>
> Dave Wedwick wrote:
>
> > Hi!
> >
> > I have a table with an int4 field called inserttime. Regardless of what
> > the user enters in this field, I want a trigger to put now() into it.
> >
> > What's the syntax for the trigger?
> >
> > Thanks!
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-02-15 00:14:27 | Re: cannot create sequence |
Previous Message | Olaf Zanger | 2001-02-14 22:52:26 | Re: cannot create sequence |