Re: Auto Insert date/time - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Auto Insert date/time
Date
Msg-id 20020408173005.A2600@svana.org
Whole thread Raw
In response to Auto Insert date/time  (impala <bhnnc@yahoo.co.uk>)
List pgsql-general
On Sun, Apr 07, 2002 at 11:06:54PM -0700, impala wrote:
> What 'serial' does for auto incrementation of intgers,
> are there something similar in PSQL where the db can
> autoinsert the correct date/time data each time you
> add a new row , without have to specify the code e.g.
> Date() class in a java/C++ file? If well, how do I
> manage to make this work? Is there maybe an PSQL
> function which can do it? AN example will be nice :)

At a guess, you would set the default value of the column to now(). I
beleive this is in the docs somewhere...

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>   http://svana.org/kleptog/
> Ignorance continues to thrive when intelligent people choose to do
> nothing.  Speaking out against censorship and ignorance is the imperative
> of all intelligent people.

pgsql-general by date:

Previous
From: Bo Lorentsen
Date:
Subject: Re: Inherit or Foreign Keys
Next
From: Denis Gasparin
Date:
Subject: Re: binary data storage