From: | Frank Finner <postgresql(at)finner(dot)de> |
---|---|
To: | impala <bhnnc(at)yahoo(dot)co(dot)uk> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Auto Insert date/time |
Date: | 2002-04-08 19:54:32 |
Message-ID: | XFMail.020408205432.postgresql@finner.de |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
something like "INSERT INTO mytable (row1,row2,rowdate) VALUES
('value1','value2',CURRENT_TIMESTAMP)" does that work for me.
The function CURRENT_TIMESTAMP gives exactly, what it´s name says: The
actual timestamp at the time of executing the query.
mfg Frank.
On 08-Apr-02 impala sat down, thought for a long time and then 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 :)
>
> Big Thanks
> Smith
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
--
Frank Finner
Thus we are all responsible for one another, through all the myriad
dimensions of time and space that make up the multiverse . . .
(M. Moorcock, "The Revenge Of The Rose")
From | Date | Subject | |
---|---|---|---|
Next Message | Nigel J. Andrews | 2002-04-08 20:02:56 | Re: PHP, HTML Forms & PostgreSQL |
Previous Message | Tom Lane | 2002-04-08 19:53:07 | Re: vacuuming not working? |