Re: CURRENT_TIMESTAMP and actual time

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: "Christopher J(dot) Bottaro" <cjbottaro(at)alumni(dot)cs(dot)utexas(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CURRENT_TIMESTAMP and actual time
Date: 2005-04-22 17:53:21
Message-ID: 20050422175321.GM58835@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Take a look at the tod() function at the very end of
http://svn.rrs.decibel.org/viewcvs.cgi/trunk/rrs_functions.sql?rev=61&view=markup

On Wed, Apr 20, 2005 at 04:17:05PM -0500, Christopher J. Bottaro wrote:
> Hi,
> I understand that CURRENT_TIMESTAMP marks the beginning of the current
> transaction. I want it to be the _actual_ time. How do I do this?
> timeofday() returns a string, how do I convert that into a TIMESTAMP?
>
> Is it possible to create a column with DEFAULT value evaluated to the actual
> current time (i.e. not the CURRENT_TIMESTAMP which is the beginning of the
> current transaction).
>
> What I do now to get it to work is do a COMMIT right before the insert, that
> way CURRENT_TIMESTAMP is (pretty close to) the actual time. ...but that is
> so crappy and doesn't work if I actually need to use transactional features
> (i.e. rollback).
>
> Thanks for the help,
> -- C
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

--
Jim C. Nasby, Database Consultant decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2005-04-22 17:55:21 Re: Migrating MySQL app to postgres?
Previous Message Joshua D. Drake 2005-04-22 17:50:42 Re: Migrating MySQL app to postgres?