Re: [ADMIN] example of insert timestamp

2008-02-25 Thread Aaron Bono
On Mon, Feb 25, 2008 at 8:05 PM, Jamie A Lawrence <[EMAIL PROTECTED]> wrote: > > On Feb 25, 2008, at 8:19 PM, Gregory Williamson wrote: > > > > Perhaps, make the column so it has a default value of now, land then > > insert without specifying the timestamp column so it gets the > > default value:

Re: [ADMIN] example of insert timestamp

2008-02-25 Thread Aaron Bono
On Mon, Feb 25, 2008 at 7:21 PM, David Bear <[EMAIL PROTECTED]> wrote: > 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 invo

Re: [ADMIN] example of insert timestamp

2008-02-25 Thread Jamie A Lawrence
On Feb 25, 2008, at 8:19 PM, Gregory Williamson wrote: Perhaps, make the column so it has a default value of now, land then insert without specifying the timestamp column so it gets the default value: create table foo (q_i_time timestamp with time zone not null default now(), someval in

Re: [ADMIN] example of insert timestamp

2008-02-25 Thread Gregory Williamson
David -- > > 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. Perhaps, make the column so it has a default va

Re: [ADMIN] example of insert timestamp

2008-02-25 Thread David Bear
On Monday 25 February 2008 18:21, Aaron Bono wrote: > On Mon, Feb 25, 2008 at 7:21 PM, David Bear <[EMAIL PROTECTED]> wrote: > > 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 com

Re: [ADMIN] example of insert timestamp

2008-02-25 Thread Steve Holdoway
On Mon, 25 Feb 2008 18:21:19 -0700 David Bear <[EMAIL PROTECTED]> wrote: > 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 i

[ADMIN] example of insert timestamp

2008-02-25 Thread David Bear
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