Re: serial data type - Mailing list pgsql-general

From Tom Allison
Subject Re: serial data type
Date
Msg-id 41561BF8.8050003@tacocat.net
Whole thread Raw
In response to Re: serial data type  (Doug McNaught <doug@mcnaught.org>)
List pgsql-general

Doug McNaught wrote:
> Joseph Healy <joe_healy@dodo.com.au> writes:
>
>
>>On Sat, Sep 25, 2004 at 07:20:23PM -0400, Tom Allison wrote:
>>
>>>Any idea how to set up a timestamp=now on every insert/update ?
>>
>>when you create your table, use:
>>
>>create table mytable (
>>        id serial primary key,
>>    updated timestamp default(now()),
>>    mydata int4
>>);
>
>
> That won't change the timestamp on UPDATE queries; you need a trigger
> for that.

Thanks!
Understood.

I'll get to that tomorrow.  Right now I'm working on data types and
tables....

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: R?f. : Re: v8 on AIX5.2
Next
From: Tom Allison
Date:
Subject: Use of 'interval'