Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Timestamp not working

Question posted by: Si (Guest) on November 23rd, 2005 02:04 AM
I have added a field to one of my PostgreSQL tables in the "Timestamp"
datatype, but when I add a row to that table I don't get the date and time
inserted into that column? Do I need to put a default value into the column
too?


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Stephen Prinster's Avatar
Stephen Prinster
Guest
n/a Posts
November 23rd, 2005
02:04 AM
#2

Re: Timestamp not working
Si wrote:[color=blue]
> I have added a field to one of my PostgreSQL tables in the "Timestamp"
> datatype, but when I add a row to that table I don't get the date and time
> inserted into that column? Do I need to put a default value into the column
> too?
>
>[/color]
Yep. I haven't done this for a while, but if my memory serves me, you
need to use CURRENT_TIME, CURRENT_DATE, or CURRENT_TIMESTAMP as a
default value to populate the column. For more on these functions, see
the docs:

http://www.postgresql.org/docs/8.0/...s-datetime.html

 
Not the answer you were looking for? Post your question . . .
183,968 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors