Re: How do I make a timestamp column default to current time - Mailing list pgsql-general

From John D. Burger
Subject Re: How do I make a timestamp column default to current time
Date
Msg-id e54617506699a152613f93922789c4f8@mitre.org
Whole thread Raw
In response to Re: How do I make a timestamp column default to current time  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How do I make a timestamp column default to current time  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane writes:

> Try
>
>     mycol timestamp default now()
> or
>     mycol timestamp default current_timestamp
>
> (the latter is actually a function call, even though the SQL standard
> says it has to be spelled without any parentheses)

And both of these return start time of the current transaction, yes?
Is it the case that there is no SQL-standard way to get the current
time?  I know Postgresql has timeofday(), but it's not standard (plus
it's weird that it returns a text string).

- John D. Burger
   MITRE


pgsql-general by date:

Previous
From: Philip Hallstrom
Date:
Subject: Re: Replication & web apps
Next
From: Robert Treat
Date:
Subject: Re: PostgreSQL scalability concerns