Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C8F682E0039 for ; Mon, 25 Feb 2008 21:16:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 04955-06 for ; Mon, 25 Feb 2008 21:16:26 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from epo-int2.asu.edu (epo-int2.asu.edu [129.219.187.21]) by postgresql.org (Postfix) with ESMTP id AD1472E003E for ; Mon, 25 Feb 2008 21:16:26 -0400 (AST) Received: from cyrus.dhcp.asu.edu (cyrus.dhcp.asu.edu [129.219.57.91]) by epo-int2.asu.edu (Switch-3.1.8/Switch-3.1.7/asu-postoffice-prod) with ESMTP id m1Q1GKRt004062 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Mon, 25 Feb 2008 18:16:20 -0700 From: David Bear To: pgsql-admin@postgresql.org Subject: example of insert timestamp Date: Mon, 25 Feb 2008 18:21:19 -0700 User-Agent: KMail/1.9.5 Organization: College of Public Programs MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802251821.19453.david.bear@asu.edu> X-Virus-Scanned: by amavisd-new X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/326 X-Sequence-Number: 28400 I've been reading about triggers on insert and found the page at http://www.postgresql.org/docs/8.1/interactive/triggers.html 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 advise. 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