Re: serial data type - Mailing list pgsql-general

From Joseph Healy
Subject Re: serial data type
Date
Msg-id 20040926000133.GB17139@joes
Whole thread Raw
In response to Re: serial data type  (Tom Allison <tallison@tacocat.net>)
Responses Re: serial data type
List pgsql-general
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
);

Joe


pgsql-general by date:

Previous
From: gearond@fireserve.net
Date:
Subject: IN or JOIN
Next
From: Doug McNaught
Date:
Subject: Re: serial data type