Re: serial data type

From: Tom Allison <tallison(at)tacocat(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: serial data type
Date: 2004-09-26 01:31:36
Message-ID: 41561BF8.8050003@tacocat.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doug McNaught wrote:
> Joseph Healy <joe_healy(at)dodo(dot)com(dot)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....

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Allison 2004-09-26 01:33:37 Use of 'interval'
Previous Message Bruce Momjian 2004-09-26 01:10:29 Re: R?f. : Re: v8 on AIX5.2