CURRENT_TIMESTAMP and actual time

From: "Christopher J(dot) Bottaro" <cjbottaro(at)alumni(dot)cs(dot)utexas(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: CURRENT_TIMESTAMP and actual time
Date: 2005-04-20 21:17:05
Message-ID: d46gj1$tnh$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2005-04-20 21:50:14 Re: Regular expression. How to disable ALL meta-character
Previous Message Alvaro Herrera 2005-04-20 20:10:50 Re: Strange interaction of union and expressions