Re: serial data type

From: Joseph Healy <joe_healy(at)dodo(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: serial data type
Date: 2004-09-26 00:01:33
Message-ID: 20040926000133.GB17139@joes
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message gearond 2004-09-26 00:20:54 IN or JOIN
Previous Message Doug McNaught 2004-09-25 23:33:16 Re: serial data type