pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan McGrath <dmcgrath19@home.com>
To: Dave Wedwick <news@wedwick.com>
Subject: Re: Trigger question
Date: Wed, 14 Feb 2001 18:20:09 -0500
Message-ID: <3A8B12A9.416F51A3@home.com> (raw)
References: <3A8754BB.382CBDBE@wedwick.com>
	<3A8A9EF5.8C8929C@wedwick.com>

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!




view thread (14+ messages)  latest in thread

Message-ID: <3A8B12A9.416F51A3@home.com>
Permalink:  ../3A8B12A9.416F51A3@home.com/
Also on:    postgresql.org/message-id/3A8B12A9.416F51A3@home.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dmcgrath19@home.com, news@wedwick.com
  Subject: Re: Trigger question
  In-Reply-To: <3A8B12A9.416F51A3@home.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox