Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux