Re: How do I make a timestamp column default to current time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John D(dot) Burger" <john(at)mitre(dot)org>
Cc: PostgreSQL-general general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do I make a timestamp column default to current time
Date: 2006-03-16 20:36:45
Message-ID: 19937.1142541405@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"John D. Burger" <john(at)mitre(dot)org> writes:
>> mycol timestamp default now()
>> or
>> mycol timestamp default current_timestamp

> 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?

AFAIK the spec doesn't really define the meaning of current_timestamp
all that closely. I believe there's a patch in the queue to add some
additional nonstandard functions for current time and start of current
interactive command, though.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mario Gonzalez 2006-03-16 20:38:45 Re: [GENERAL] Concurrencia
Previous Message Stephen Frost 2006-03-16 20:17:09 Re: ERROR: FULL JOIN is only supported with merge-joinable join conditions