Re: CURRENT_TIMESTAMP vs actual time - Mailing list pgsql-general

From Ben Trewern
Subject Re: CURRENT_TIMESTAMP vs actual time
Date
Msg-id d46p71$2ge6$1@news.hub.org
Whole thread Raw
In response to CURRENT_TIMESTAMP vs actual time  ("Christopher J. Bottaro" <cjbottaro@alumni.cs.utexas.edu>)
List pgsql-general
Try SELECT timeofday()::TIMESTAMP;

Regards,

Ben
""Christopher J. Bottaro"" <cjbottaro@alumni.cs.utexas.edu> wrote in message
news:d46k11$6nc$1@sea.gmane.org...
> 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 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>



pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: Regular expression. How to disable ALL meta-character
Next
From: "Ben Trewern"
Date:
Subject: Re: Binary or compiled version?