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

example of insert timestamp

From: David Bear <david(dot)bear(at)asu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: example of insert timestamp
Date: 2008-02-26 01:21:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I've been reading about triggers on insert and found the page at with some sample 
code in the comments.

I'm thinking what I want can't really be this involved.

I want to have a table with a timestamp field that automatically gets the 
value of now() on insert. The timestamp will never be updated. I assume I 
need to create a trigger to do this. If there is an easier way, please 

Otherwise, is there any sample code that would should be how to do this? The 
sample on the page above looks like overkill.


David Bear
College of Public Programs/ASU
411 N Central, Phoenix, AZ 85004


pgsql-admin by date

Next:From: Aaron BonoDate: 2008-02-26 01:21:21
Subject: Re: example of insert timestamp
Previous:From: Gregory WilliamsonDate: 2008-02-26 01:19:56
Subject: Re: example of insert timestamp

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